From: Hannu Niemistö Date: Thu, 19 Jul 2018 11:18:29 +0000 (+0000) Subject: Merge "Use Runtime.halt instead of System.exit in delayed shutdown" X-Git-Tag: v1.43.0~136^2~441 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=64be7691aa27c056cf27d4da811ed57027235c63;hp=d2a7847eec81903a5a48a8e764be5c87851cdef6;p=simantics%2Fplatform.git Merge "Use Runtime.halt instead of System.exit in delayed shutdown" --- diff --git a/bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchApplication.java b/bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchApplication.java index aaacddc46..50e8aada7 100644 --- a/bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchApplication.java +++ b/bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchApplication.java @@ -193,7 +193,9 @@ public class SimanticsWorkbenchApplication implements IApplication, IExecutableE try { Thread.sleep(delayMs); LOGGER.warn("Delayed shutdown forced the application to exit with code {}.", exitCode); - System.exit(exitCode); + // Method halt is used instead of System.exit, because running + // of shutdown hooks hangs the application in some cases. + Runtime.getRuntime().halt(exitCode); } catch (InterruptedException e) { e.printStackTrace(); }