Skip to content

Commit 20dced6

Browse files
committed
Fix exception when closing JabRef
Fixes #5348 by using JavaFX windows instead of awt windows.
1 parent caafef1 commit 20dced6

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
2020
- Inherit fields from cross-referenced entries as specified by biblatex. [#5045](https://github.com/JabRef/jabref/issues/5045)
2121
- We fixed an issue where it was no longer possible to connect to LibreOffice. [#5261](https://github.com/JabRef/jabref/issues/5261)
2222
- The "All entries group" is no longer shown when no library is open.
23+
- We fixed an exception which occurred when closing JabRef. [#5348](https://github.com/JabRef/jabref/issues/5348)
2324
- 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)
2425
- The group panel is now properly updated when switching between libraries (or when closing/opening one). [#3142](https://github.com/JabRef/jabref/issues/3142)
2526
- 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)
2627
- We fixed an error mentioning "javafx.controls/com.sun.javafx.scene.control" that was thrown when interacting with the toolbar.
2728
- We fixed an error where a cleared search was restored after switching libraries. [#4846](https://github.com/JabRef/jabref/issues/4846)
28-
- 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)
29+
- 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)
2930

3031

3132
### Removed

src/main/java/org/jabref/gui/JabRefFrame.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.jabref.gui;
22

3-
import java.awt.Window;
43
import java.io.File;
54
import java.io.IOException;
65
import java.nio.file.Path;
@@ -42,6 +41,7 @@
4241
import javafx.scene.layout.Pane;
4342
import javafx.scene.layout.Priority;
4443
import javafx.stage.Stage;
44+
import javafx.stage.Window;
4545

4646
import org.jabref.Globals;
4747
import org.jabref.JabRefExecutorService;
@@ -367,11 +367,9 @@ private void tearDownJabRef(List<String> filenames) {
367367
fileHistory.storeHistory();
368368
prefs.flush();
369369

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

0 commit comments

Comments
 (0)