From 0e36273ab9bb6527f71a1b4618e282c80c8855ff Mon Sep 17 00:00:00 2001 From: Ziedelth Date: Fri, 10 Dec 2021 10:35:17 +0100 Subject: [PATCH] Fix bug on close --- src/fr/univ/lyon1/gui/MainGui.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/fr/univ/lyon1/gui/MainGui.java b/src/fr/univ/lyon1/gui/MainGui.java index 7e63630..03e4c83 100644 --- a/src/fr/univ/lyon1/gui/MainGui.java +++ b/src/fr/univ/lyon1/gui/MainGui.java @@ -2,6 +2,7 @@ package fr.univ.lyon1.gui; import fr.univ.lyon1.common.ServerConfiguration; import javafx.application.Application; +import javafx.application.Platform; import javafx.fxml.FXMLLoader; import javafx.scene.Group; import javafx.scene.Scene; @@ -46,6 +47,11 @@ public class MainGui extends Application { System.exit(1); } } + + stage.setOnCloseRequest(event -> { + Platform.exit(); + System.exit(0); + }); } private void launchServerConfiguration(Stage stage) throws IOException {