Merge branch 'app-ends'

This commit is contained in:
Carlos Galindo 2019-09-13 12:08:18 +02:00
commit 50cefbfd53
Signed by: kauron
GPG Key ID: 83E68706DEE119A3
2 changed files with 9 additions and 0 deletions

View File

@ -77,6 +77,8 @@ public class Controller implements Initializable {
root.getScene().getWindow().setOnCloseRequest(event -> {
for (Tab tab : tabPane.getTabs()) {
EventHandler<Event> handler = tab.getOnCloseRequest();
if (tabMap.containsKey(tab))
tabMap.get(tab).stopTimer();
if (tab.isClosable() && handler != null) {
tabPane.getSelectionModel().select(tab);
handler.handle(event);

View File

@ -209,4 +209,11 @@ public class TableController implements Initializable {
timerTask = null;
}
}
void stopTimer() {
timer.cancel();
timer.purge();
if (timerTask != null)
timerTask.cancel();
}
}