diff --git a/CHANGELOG.md b/CHANGELOG.md index 16e58e2059f..8fb1db1e495 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ We refer to [GitHub issues](/~https://github.com/JabRef/jabref/issues) by using `# - We added support for '[entrytype]' bracketed expression. ### Fixed + - We fixed an issue where JabRef would not terminated after asking to collect anonymous statistics [#2955 comment](/~https://github.com/JabRef/jabref/issues/2955#issuecomment-334591123) ### Removed diff --git a/src/main/java/org/jabref/gui/JabRefFrame.java b/src/main/java/org/jabref/gui/JabRefFrame.java index 92095b78852..6f27b48b28f 100644 --- a/src/main/java/org/jabref/gui/JabRefFrame.java +++ b/src/main/java/org/jabref/gui/JabRefFrame.java @@ -30,9 +30,7 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; +import java.util.TimerTask; import javax.swing.AbstractAction; import javax.swing.Action; @@ -64,6 +62,7 @@ import javafx.application.Platform; import org.jabref.Globals; +import org.jabref.JabRefExecutorService; import org.jabref.gui.actions.Actions; import org.jabref.gui.actions.AutoLinkFilesAction; import org.jabref.gui.actions.ConnectToSharedDatabaseAction; @@ -661,8 +660,13 @@ public void windowClosing(WindowEvent e) { private void initShowTrackingNotification() { if (!Globals.prefs.shouldAskToCollectTelemetry()) { - ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor(); - scheduler.schedule(() -> DefaultTaskExecutor.runInJavaFXThread(this::showTrackingNotification), 1, TimeUnit.MINUTES); + JabRefExecutorService.INSTANCE.submit(new TimerTask() { + + @Override + public void run() { + DefaultTaskExecutor.runInJavaFXThread(JabRefFrame.this::showTrackingNotification); + } + }, 60000); // run in one minute } }