Skip to content

Commit 3f13d99

Browse files
committed
UIService: quit more gracefully
If the UIService never initialized, and then an AppQuitEvent fires, there is no need to proactively discover the UIs and save their locations, since clearly nothing changed with the UI.
1 parent 7756d04 commit 3f13d99

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/org/scijava/ui/DefaultUIService.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,10 @@ public void run() {
436436
}
437437

438438
@EventHandler
439-
protected void onEvent(@SuppressWarnings("unused") final AppQuitEvent event) {
439+
protected synchronized void onEvent(
440+
@SuppressWarnings("unused") final AppQuitEvent event)
441+
{
442+
if (!initialized) return;
440443
for (final UserInterface ui : getVisibleUIs()) {
441444
ui.saveLocation();
442445
}

0 commit comments

Comments
 (0)