Skip to content

Commit

Permalink
[TS-561] Fix correct unregistering when failing during onEnable
Browse files Browse the repository at this point in the history
Closes #561
  • Loading branch information
erikzimmermann committed Dec 30, 2024
1 parent 5c3d070 commit 0650b4e
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,18 +147,18 @@ public void onDisable() {
UniversalScheduler.getScheduler(this).cancelTasks();

printConsoleInfo(() -> {
this.tradeHandler.disable();
tradeHandler.disable();

this.tradeCMD.unregister();
this.tradeSystemCMD.unregister();
if (this.tradeLogCMD != null) this.tradeLogCMD.unregister();
if (tradeCMD != null) tradeCMD.unregister();
if (tradeSystemCMD != null) tradeSystemCMD.unregister();
if (tradeLogCMD != null) tradeLogCMD.unregister();

//unregister packet channels
if (this.spigotHandler != null) this.spigotHandler.onDisable();
this.proxyDataHandler.onDisable();
if (spigotHandler != null) spigotHandler.onDisable();
proxyDataHandler.onDisable();

HandlerList.unregisterAll(this);
this.fileManager.destroy();
fileManager.destroy();

PluginDependencies.disable();

Expand Down

0 comments on commit 0650b4e

Please sign in to comment.