Skip to content

Commit

Permalink
Merge pull request AY2324S2-CS2103-F15-2#173 from gowthaman-01/issue-143
Browse files Browse the repository at this point in the history
Ensure note windows close when app closes
  • Loading branch information
AL-ZT authored Apr 15, 2024
2 parents 7a008ae + 632ff7d commit ba1b868
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/seedu/address/MainApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.logging.Logger;

import javafx.application.Application;
import javafx.application.Platform;
import javafx.stage.Stage;
import seedu.address.commons.core.Config;
import seedu.address.commons.core.LogsCenter;
Expand Down Expand Up @@ -177,6 +178,9 @@ protected CommandHistory initCommandHistory() {
public void start(Stage primaryStage) {
logger.info("Starting AddressBook " + MainApp.VERSION);
ui.start(primaryStage);
primaryStage.setOnCloseRequest(event -> {
Platform.exit();
});
}

@Override
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/seedu/address/ui/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.logging.Logger;

import javafx.application.Platform;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.MenuItem;
Expand Down Expand Up @@ -211,6 +212,7 @@ private void handleExit() {
viewWindow.hide();
helpWindow.hide();
primaryStage.hide();
Platform.exit();
}

public PersonListPanel getPersonListPanel() {
Expand Down

0 comments on commit ba1b868

Please sign in to comment.