From 3dadfe5e85d98e36f2c2aaa92ce136e43aaae6d0 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sat, 28 Jan 2012 03:45:49 +0100 Subject: [PATCH] Properly unregister plugin channels when a plugin gets disabled. By: Meaglin --- .../main/java/org/bukkit/plugin/SimplePluginManager.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java index cc99bf8344..e302bcc084 100644 --- a/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -416,6 +416,13 @@ public final class SimplePluginManager implements PluginManager { } catch (Throwable ex) { server.getLogger().log(Level.SEVERE, "Error occurred (in the plugin loader) while unregistering events for " + plugin.getDescription().getFullName() + " (Is it up to date?): " + ex.getMessage(), ex); } + + try { + server.getMessenger().unregisterIncomingPluginChannel(plugin); + server.getMessenger().unregisterOutgoingPluginChannel(plugin); + } catch(Throwable ex) { + server.getLogger().log(Level.SEVERE, "Error occurred (in the plugin loader) while unregistering plugin channels for " + plugin.getDescription().getFullName() + " (Is it up to date?): " + ex.getMessage(), ex); + } } }