Skip to content

Commit

Permalink
Properly clean up the plugin ref in the manager.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stéphan Kochen committed Feb 25, 2011
1 parent f5d0e03 commit 702b596
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/org/bukkit/plugin/SimplePluginManager.java
Expand Up @@ -197,10 +197,12 @@ public void enableAllPlugins() {
* {@inheritDoc}
*/
public void disablePlugin(final Plugin plugin) {
callEvent(new PluginEvent(Event.Type.PLUGIN_DISABLE, plugin));
PluginDescription description = plugin.getDescription();

plugin.getDescription().getLoader().disablePlugin(plugin);
callEvent(new PluginEvent(Event.Type.PLUGIN_DISABLE, plugin));

description.getLoader().disablePlugin(plugin);
plugins.remove(description.getName());
clearEvents(plugin);
commandMap.clearCommands(plugin);
server.getScheduler().cancelTasks(plugin);
Expand Down

0 comments on commit 702b596

Please sign in to comment.