From 4dda3eb992472f5ea3903725f7497a0728c66140 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Hannu=20Niemist=C3=B6?= Date: Wed, 18 Jul 2018 13:26:07 +0300 Subject: [PATCH] Use Runtime.halt instead of System.exit in delayed shutdown Change-Id: I4c43ff1f73639948bcefa4bf3c41cf4a06ff6b95 --- .../workbench/internal/SimanticsWorkbenchApplication.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(); } -- 2.43.2