Skip to content

Commit

Permalink
Fix exception when closing JabRef
Browse files Browse the repository at this point in the history
Fixes #5348 by using JavaFX windows instead of awt windows.
  • Loading branch information
tobiasdiez committed Sep 25, 2019
1 parent caafef1 commit 20dced6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- Inherit fields from cross-referenced entries as specified by biblatex. [#5045](https://github.com/JabRef/jabref/issues/5045)
- We fixed an issue where it was no longer possible to connect to LibreOffice. [#5261](https://github.com/JabRef/jabref/issues/5261)
- The "All entries group" is no longer shown when no library is open.
- We fixed an exception which occurred when closing JabRef. [#5348](https://github.com/JabRef/jabref/issues/5348)
- After assigning an entry to a group, the item count is now properly colored to reflect the new membership of the entry. [#3112](https://github.com/JabRef/jabref/issues/3112)
- The group panel is now properly updated when switching between libraries (or when closing/opening one). [#3142](https://github.com/JabRef/jabref/issues/3142)
- We fixed an error where the number of matched entries shown in the group pane was not updated correctly. [#4441](https://github.com/JabRef/jabref/issues/4441)
- We fixed an error mentioning "javafx.controls/com.sun.javafx.scene.control" that was thrown when interacting with the toolbar.
- We fixed an error where a cleared search was restored after switching libraries. [#4846](https://github.com/JabRef/jabref/issues/4846)
- We fixed an exception which occured when trying to open a non existing file from the "Recent files"-menu [#5334](https://github.com/JabRef/jabref/issues/5334)
- We fixed an exception which occurred when trying to open a non existing file from the "Recent files"-menu [#5334](https://github.com/JabRef/jabref/issues/5334)


### Removed
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.jabref.gui;

import java.awt.Window;
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
Expand Down Expand Up @@ -42,6 +41,7 @@
import javafx.scene.layout.Pane;
import javafx.scene.layout.Priority;
import javafx.stage.Stage;
import javafx.stage.Window;

import org.jabref.Globals;
import org.jabref.JabRefExecutorService;
Expand Down Expand Up @@ -367,11 +367,9 @@ private void tearDownJabRef(List<String> filenames) {
fileHistory.storeHistory();
prefs.flush();

// dispose all windows, even if they are not displayed anymore
// TODO: javafx variant only avaiable in java 9 and updwards
// https://docs.oracle.com/javase/9/docs/api/javafx/stage/Window.html#getWindows--
// Close all open windows
for (Window window : Window.getWindows()) {
window.dispose();
window.hide();
}
}

Expand Down

0 comments on commit 20dced6

Please sign in to comment.