From 034a7d58b0caa4fed200d0682fe6e75ea4562e85 Mon Sep 17 00:00:00 2001 From: asofold Date: Sat, 26 Jan 2013 07:41:51 +0100 Subject: [PATCH] Fix unregistering of components from allComponents. --- .../main/java/fr/neatmonster/nocheatplus/NoCheatPlus.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/NoCheatPlus.java b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/NoCheatPlus.java index 04039582..6c629a61 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/NoCheatPlus.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/NoCheatPlus.java @@ -325,6 +325,7 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI { notifyReload.remove(obj); } dataMan.removeComponent(obj); + allComponents.remove(obj); } /* (non-Javadoc) @@ -345,7 +346,7 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI { // Remove listener references. if (verbose){ if (listenerManager.hasListenerMethods()) LogUtil.logInfo("[NoCheatPlus] Cleanup ListenerManager..."); - else LogUtil.logInfo("[NoCheatPlus] (ListenerManager empty...)"); + else LogUtil.logInfo("[NoCheatPlus] (ListenerManager not in use, prevent registering...)"); } listenerManager.setRegisterDirectly(false); listenerManager.clear(); @@ -369,6 +370,7 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI { getServer().getScheduler().cancelTasks(this); // Exemptions cleanup. + if (verbose) LogUtil.logInfo("[NoCheatPlus] Reset ExemptionManager..."); NCPExemptionManager.clear(); // Data cleanup. @@ -380,7 +382,8 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI { // (No native hooks present, yet.) // Unregister all added components explicitly. - for (Object obj : allComponents){ + if (verbose) LogUtil.logInfo("[NoCheatPlus] Unregister all registered components..."); + for (Object obj : new ArrayList(allComponents)){ removeComponent(obj); }