From 538560a8cd55c525c10a0fa48f4aedab06c62bbc Mon Sep 17 00:00:00 2001 From: Pepich Date: Fri, 5 May 2017 10:08:44 +0200 Subject: [PATCH] Fixed potential memory leak --- .../redstoner/coremods/moduleLoader/ModuleLoader.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/com/redstoner/coremods/moduleLoader/ModuleLoader.java b/src/com/redstoner/coremods/moduleLoader/ModuleLoader.java index 35f7e75..4503332 100644 --- a/src/com/redstoner/coremods/moduleLoader/ModuleLoader.java +++ b/src/com/redstoner/coremods/moduleLoader/ModuleLoader.java @@ -37,7 +37,7 @@ import net.minecraft.server.v1_11_R1.MinecraftServer; /** The module loader, mother of all modules. Responsible for loading and taking care of all modules. * * @author Pepich */ -@Version(major = 3, minor = 2, revision = 2, compatible = 2) +@Version(major = 3, minor = 2, revision = 3, compatible = 2) public final class ModuleLoader implements CoreModule { private static ModuleLoader instance; @@ -322,6 +322,13 @@ public final class ModuleLoader implements CoreModule } String[] commands = getAllHooks(module).toArray(new String[] {}); CommandManager.unregisterAll(commands); + try + { + loaders.get(module).close(); + } + catch (IOException e) + {} + loaders.remove(module); } }