Server thread stops when window has been closed

This commit is contained in:
Michael Rausch
2017-05-04 12:35:36 +12:00
parent e37b244f45
commit 8521b68855
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -1,7 +1,6 @@
package seng302;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
@@ -20,8 +19,9 @@ public class App extends Application
primaryStage.setMaximized(true);
primaryStage.show();
primaryStage.setOnCloseRequest(e -> {
Platform.exit();
System.exit(0);
});
}
@@ -98,7 +98,7 @@ public class ServerThread implements Runnable, Observer {
boatStatus = BoatStatus.PRESTART;
thereAreBoatsNotFinished = true;
}
BoatSubMessage m = new BoatSubMessage(b.getSourceID(), boatStatus, b.getLastPassedCorner().getSeqID(), 0, 0, b.getEstimatedTimeTillFinish(), b.getEstimatedTimeTillFinish());
boatSubMessages.add(m);
}