mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Catch setEnabled to ensure classloader is properly unloaded (#10020)
This commit is contained in:
parent
a3a40ecd2b
commit
a52612213b
1 changed files with 5 additions and 2 deletions
|
@ -3994,8 +3994,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ plugin.getLogger().info("Disabling %s".formatted(pluginName));
|
||||
+
|
||||
+ this.server.getPluginManager().callEvent(new PluginDisableEvent(plugin));
|
||||
+
|
||||
+ javaPlugin.setEnabled(false);
|
||||
+ try {
|
||||
+ javaPlugin.setEnabled(false);
|
||||
+ } catch (Throwable ex) {
|
||||
+ this.server.getLogger().log(Level.SEVERE, "Error occurred while disabling " + pluginName, ex);
|
||||
+ }
|
||||
+
|
||||
+ ClassLoader classLoader = plugin.getClass().getClassLoader();
|
||||
+ if (classLoader instanceof ConfiguredPluginClassLoader configuredPluginClassLoader) {
|
||||
|
|
Loading…
Reference in a new issue