Make sure we don't call exitProcess() if the system is already terminating

This commit is contained in:
ceikry
2022-05-16 07:28:32 -05:00
committed by Ryan
parent 77320289b5
commit 7faa0a2c7c
2 changed files with 3 additions and 2 deletions
@@ -14,6 +14,6 @@ public final class SystemShutdownHook implements Runnable {
return; return;
} }
SystemLogger.logInfo("[SystemShutdownHook] Terminating..."); SystemLogger.logInfo("[SystemShutdownHook] Terminating...");
SystemManager.getTerminator().terminate(); SystemManager.flag(SystemState.TERMINATED);
} }
} }
+1
View File
@@ -109,6 +109,7 @@ object Server {
it.flush() it.flush()
it.close() it.close()
} }
if(!SystemManager.isTerminated())
exitProcess(0) exitProcess(0)
} }
delay(625) delay(625)