Skip to content

Commit

Permalink
Shutdown executor service on disable (#2570)
Browse files Browse the repository at this point in the history
* Shutdown executor service on disable

* also do CLI
  • Loading branch information
me4502 authored Jul 7, 2024
1 parent 27bd266 commit 84ad34c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ public void onDisable() {
config.unload();
}
this.getServer().getScheduler().cancelTasks(this);
worldEdit.getExecutorService().shutdown();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ public void onStopped() {
WorldEdit worldEdit = WorldEdit.getInstance();
worldEdit.getSessionManager().unload();
worldEdit.getPlatformManager().unregister(platform);
WorldEdit.getInstance().getExecutorService().shutdown();
}

public FileRegistries getFileRegistries() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ private void onStopServer(MinecraftServer minecraftServer) {
WorldEdit worldEdit = WorldEdit.getInstance();
worldEdit.getSessionManager().unload();
WorldEdit.getInstance().getEventBus().post(new PlatformUnreadyEvent(platform));
WorldEdit.getInstance().getExecutorService().shutdown();
}

private boolean skipEvents() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ public void serverStopping(ServerStoppingEvent event) {
WorldEdit worldEdit = WorldEdit.getInstance();
worldEdit.getSessionManager().unload();
WorldEdit.getInstance().getEventBus().post(new PlatformUnreadyEvent(platform));
WorldEdit.getInstance().getExecutorService().shutdown();
}

@SubscribeEvent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ public void serverStopping(StoppingEngineEvent<Server> event) {
WorldEdit worldEdit = WorldEdit.getInstance();
worldEdit.getSessionManager().unload();
WorldEdit.getInstance().getEventBus().post(new PlatformUnreadyEvent(platform));
WorldEdit.getInstance().getExecutorService().shutdown();
}

@Listener
Expand Down

0 comments on commit 84ad34c

Please sign in to comment.