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
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
||||||
public synchronized void shutdown(@Range(from = 0, to = 255) int exitCode) {
|
public synchronized void shutdown(@Range(from = 0, to = 255) int exitCode) {
|
||||||
switch (state) {
|
if (state == EngineState.UNKNOWN || state == EngineState.SHUTDOWN)
|
||||||
case UNKNOWN, SHUTDOWN, CRASHED -> {
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.info("Shutting engine down");
|
logger.info("Shutting engine down");
|
||||||
if (state != EngineState.CRASHED)
|
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
|
// Shutdown engine/JVM
|
||||||
if (!throwableHandled)
|
if (!throwableHandled)
|
||||||
if (EngineConfiguration.getInstance().isLoggerImmediateShutdown())
|
if (EngineConfiguration.getInstance().isLoggerImmediateShutdown()) {
|
||||||
|
System.out.println("Halting JVM");
|
||||||
Runtime.getRuntime().halt(69);
|
Runtime.getRuntime().halt(69);
|
||||||
else
|
} else
|
||||||
Engine.getInstance().shutdown(69);
|
Engine.getInstance().shutdown(69);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue