forked from j62/ctbrec
Shut down more gracefully (hopefully)
This commit is contained in:
parent
c7e07b4b26
commit
75ab95e1ea
|
@ -178,9 +178,13 @@ public class CamrecApplication extends Application {
|
||||||
try {
|
try {
|
||||||
Config.getInstance().save();
|
Config.getInstance().save();
|
||||||
LOG.info("Shutdown complete. Goodbye!");
|
LOG.info("Shutdown complete. Goodbye!");
|
||||||
Platform.exit();
|
Platform.runLater(() -> {
|
||||||
// This is needed, because OkHttp?! seems to block the shutdown with its writer threads. They are not daemon threads :(
|
primaryStage.close();
|
||||||
System.exit(0);
|
shutdownInfo.close();
|
||||||
|
Platform.exit();
|
||||||
|
// This is needed, because OkHttp?! seems to block the shutdown with its writer threads. They are not daemon threads :(
|
||||||
|
System.exit(0);
|
||||||
|
});
|
||||||
} catch (IOException e1) {
|
} catch (IOException e1) {
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
Alert alert = new AutosizeAlert(Alert.AlertType.ERROR);
|
Alert alert = new AutosizeAlert(Alert.AlertType.ERROR);
|
||||||
|
|
Loading…
Reference in New Issue