Fix crashes not shutting down engine
This commit is contained in:
parent
a9cfc8c810
commit
ebbc1778ae
2 changed files with 5 additions and 7 deletions
|
@ -454,11 +454,8 @@ public final class Engine extends SubsystemClass {
|
|||
* @since v1-alpha0
|
||||
*/
|
||||
public synchronized void shutdown(@Range(from = 0, to = 255) int exitCode) {
|
||||
switch (state) {
|
||||
case UNKNOWN, SHUTDOWN, CRASHED -> {
|
||||
if (state == EngineState.UNKNOWN || state == EngineState.SHUTDOWN)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
logger.info("Shutting engine down");
|
||||
if (state != EngineState.CRASHED)
|
||||
|
|
|
@ -171,9 +171,10 @@ Dear developer: FIX YOUR GODDAMN SHIT! Please check if your code or 3rd party su
|
|||
|
||||
// Shutdown engine/JVM
|
||||
if (!throwableHandled)
|
||||
if (EngineConfiguration.getInstance().isLoggerImmediateShutdown())
|
||||
if (EngineConfiguration.getInstance().isLoggerImmediateShutdown()) {
|
||||
System.out.println("Halting JVM");
|
||||
Runtime.getRuntime().halt(69);
|
||||
else
|
||||
} else
|
||||
Engine.getInstance().shutdown(69);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue