]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchApplication.java
Use Runtime.halt instead of System.exit in delayed shutdown
[simantics/platform.git] / bundles / org.simantics.workbench / src / org / simantics / workbench / internal / SimanticsWorkbenchApplication.java
index aaacddc460addfea176ea7f9ef45794cb7e7ee8e..50e8aada7b3f4cd3c14acdeee796427123db7dab 100644 (file)
@@ -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();
                 }