From 98505246b1d59facbca84880dfdd099f40a5841c Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Tue, 25 Nov 2014 13:23:10 +0100 Subject: [PATCH] Revert "Remove System#exit call from BitsquareApp#stop" This reverts commit 78d3da0c4e17ce356905c3b745d9773eb458988e. Because while eliminating the call to System#exit does mean that JavaFX's LauncherImpl can properly report errors and stack traces, it also means that Bitsquare never shuts down (probably due to non-daemon threads). When System#exit is removed (or replaced with Platform#exit), closing the Bitsquare window (or clicking Exit from the system tray menu) results in the application no longer being able to function at the UI level (because the JavaFX toolkit has essentially been shut down), but the process does not exit either. So in the meantime, this change is being reverted, and we just have to deal with not getting stack traces at the command line when uncaught exceptions bubble up through the #start method (specifically, exceptions that occur before the UncaughtExceptionHandler has had a chance to be set). A solution to this could be to provide a custom subclass of JavaFX's own Application class that implements a template #start / #doStart methods trying and catching anything that is raised from #doStart and printing the stack trace on its own. --- src/main/java/io/bitsquare/app/gui/BitsquareApp.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/io/bitsquare/app/gui/BitsquareApp.java b/src/main/java/io/bitsquare/app/gui/BitsquareApp.java index 8699bd5661..8b66a99c1c 100644 --- a/src/main/java/io/bitsquare/app/gui/BitsquareApp.java +++ b/src/main/java/io/bitsquare/app/gui/BitsquareApp.java @@ -148,6 +148,7 @@ public class BitsquareApp extends Application { @Override public void stop() { bitsquareAppModule.close(injector); + System.exit(0); }