Fixed errors during plugin enable/disable leaving Bukkit in an undefined state. Previous fix would at least prevent plugins from breaking the server, but it aborted the enable/disable process prematurely.

By: sk89q <the.sk89q@gmail.com>
This commit is contained in:
Bukkit/Spigot
2011-05-13 18:17:28 -07:00
parent c9d98c3313
commit 8217ff1836
2 changed files with 20 additions and 6 deletions

View File

@ -249,7 +249,7 @@ public final class SimplePluginManager implements PluginManager {
try {
plugin.getPluginLoader().enablePlugin(plugin);
} catch (Throwable ex) {
server.getLogger().log(Level.SEVERE, ex.getMessage() + " enabling " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex);
server.getLogger().log(Level.SEVERE, "Error occurred (in the plugin loader) while enabling " + plugin.getDescription().getFullName() + " (Is it up to date?): " + ex.getMessage(), ex);
}
}
}
@ -264,11 +264,13 @@ public final class SimplePluginManager implements PluginManager {
if (plugin.isEnabled()) {
try {
plugin.getPluginLoader().disablePlugin(plugin);
server.getScheduler().cancelTasks(plugin);
server.getServicesManager().unregisterAll(plugin);
} catch (Throwable ex) {
server.getLogger().log(Level.SEVERE, ex.getMessage() + " disabling " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex);
server.getLogger().log(Level.SEVERE, "Error occurredd (in the plugin loader) while disabling " + plugin.getDescription().getFullName() + " (Is it up to date?): " + ex.getMessage(), ex);
}
// Forced disable
server.getScheduler().cancelTasks(plugin);
server.getServicesManager().unregisterAll(plugin);
}
}