Fix unregisterCommand(s) - second try

This commit is contained in:
Moehritz 2014-06-16 17:01:00 +02:00 committed by md_5
parent f6e41c856c
commit 1a7efeabc4

View File

@ -82,7 +82,7 @@ public class PluginManager
*/ */
public void unregisterCommand(Command command) public void unregisterCommand(Command command)
{ {
commandMap.values().remove( command ); while ( commandMap.values().remove( command ) );
commandsByPlugin.values().remove( command ); commandsByPlugin.values().remove( command );
} }
@ -95,7 +95,8 @@ public class PluginManager
{ {
for ( Iterator<Command> it = commandsByPlugin.get( plugin ).iterator(); it.hasNext(); ) for ( Iterator<Command> it = commandsByPlugin.get( plugin ).iterator(); it.hasNext(); )
{ {
commandMap.values().remove( it.next() ); Command command = it.next();
while ( commandMap.values().remove( command ) );
it.remove(); it.remove();
} }
} }