Make CrashHandler use Engine#shutdown

This commit is contained in:
JeremyStar™ 2024-06-10 21:53:35 +02:00
parent e6fa60e287
commit 52e0f67bd2
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -19,6 +19,7 @@
package de.staropensource.sosengine.base.logging; package de.staropensource.sosengine.base.logging;
import de.staropensource.sosengine.base.Engine;
import de.staropensource.sosengine.base.EngineConfiguration; import de.staropensource.sosengine.base.EngineConfiguration;
import de.staropensource.sosengine.base.classes.Placeholder; import de.staropensource.sosengine.base.classes.Placeholder;
import de.staropensource.sosengine.base.events.EngineCrashEvent; import de.staropensource.sosengine.base.events.EngineCrashEvent;
@ -146,11 +147,11 @@ public final class CrashHandler {
// Send EngineCrash event // Send EngineCrash event
new EngineCrashEvent().callEvent(); new EngineCrashEvent().callEvent();
// Shutdown JVM // Shutdown (engine &) JVM
if (EngineConfiguration.getInstance().isLoggerImmediateShutdown()) if (EngineConfiguration.getInstance().isLoggerImmediateShutdown())
Runtime.getRuntime().halt(69); Runtime.getRuntime().halt(69);
else else
Runtime.getRuntime().exit(69); Engine.getInstance().shutdown(69);
} }
/** /**