Shutdown executor service on disable (#2570)

* Shutdown executor service on disable

* also do CLI
This commit is contained in:
Maddy Miller 2024-07-07 16:16:15 +10:00 committed by GitHub
parent 27bd26607f
commit 84ad34c36f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 5 additions and 0 deletions

View File

@ -327,6 +327,7 @@ public void onDisable() {
config.unload();
}
this.getServer().getScheduler().cancelTasks(this);
worldEdit.getExecutorService().shutdown();
}
/**

View File

@ -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() {

View File

@ -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() {

View File

@ -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

View File

@ -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