From e95f24df43c792e1e63eb7990622d236b48e8bc7 Mon Sep 17 00:00:00 2001 From: "Christian F." Date: Thu, 26 Oct 2023 08:57:02 +0200 Subject: [PATCH] WIP --- src/main/java/mediathek/mainwindow/MediathekGui.java | 4 +--- src/main/java/mediathek/tool/ApplicationConfiguration.java | 6 ++++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/mediathek/mainwindow/MediathekGui.java b/src/main/java/mediathek/mainwindow/MediathekGui.java index 6d2e14b1d1..b4587caf14 100644 --- a/src/main/java/mediathek/mainwindow/MediathekGui.java +++ b/src/main/java/mediathek/mainwindow/MediathekGui.java @@ -1131,9 +1131,7 @@ private void cleanupLuceneIndex() { * Gracefully shutdown the JavaFX environment. */ private void shutdownJavaFx() { - //FIXME macOS Sonoma 14.1 causes freezes here :-( - if (!SystemUtils.IS_OS_MAC_OSX) - JavaFxUtils.invokeInFxThreadAndWait(() -> JFXHiddenApplication.getPrimaryStage().close()); + JavaFxUtils.invokeInFxThreadAndWait(() -> JFXHiddenApplication.getPrimaryStage().close()); Platform.exit(); } diff --git a/src/main/java/mediathek/tool/ApplicationConfiguration.java b/src/main/java/mediathek/tool/ApplicationConfiguration.java index 11a16c0548..c54029c01d 100644 --- a/src/main/java/mediathek/tool/ApplicationConfiguration.java +++ b/src/main/java/mediathek/tool/ApplicationConfiguration.java @@ -80,6 +80,7 @@ public class ApplicationConfiguration { * A custom small thread scheduler exclusively for config changes. */ private final ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(2); + private final TimerTaskListener timerTaskListener = new TimerTaskListener(); private XMLConfiguration config; private FileHandler handler; /** @@ -147,7 +148,7 @@ public void setBlacklistDoNotShowGeoblockedFilms(boolean newValue) { } private void initializeTimedEventWriting() { - config.addEventListener(ConfigurationEvent.ANY, new TimerTaskListener()); + config.addEventListener(ConfigurationEvent.ANY, timerTaskListener); } private void setupXmlConfiguration() { @@ -179,7 +180,8 @@ private void loadOrCreateConfiguration() { public void writeConfiguration() { try { // cancel a pending writer task first - if (future != null) future.cancel(false); + config.removeEventListener(ConfigurationEvent.ANY, timerTaskListener); + if (future != null) future.cancel(true); handler.save(); } catch (ConfigurationException configurationException) {