Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
derreisende77 committed Oct 26, 2023
1 parent c54d55c commit e95f24d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/main/java/mediathek/mainwindow/MediathekGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/mediathek/tool/ApplicationConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
/**
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit e95f24d

Please sign in to comment.