Skip to content

Commit 8b19216

Browse files
committed
Fix app closing causing unload hooks not to fire
1 parent a784a8e commit 8b19216

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/io/github/soir20/mode/helpfuljava/ui/HelpfulJavaEditor.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ public HelpfulJavaEditor(Base base, String path, EditorState state, Mode mode) t
6666
create the listener and then register it once the preprocessing service
6767
has also been created. */
6868
updateListenerRegistration();
69+
70+
// Manually unload the page so its unload hooks are triggered on close
71+
Runtime.getRuntime().addShutdownHook(new Thread(() -> setErrorPageSilently("")));
72+
6973
}
7074

7175
/**

0 commit comments

Comments
 (0)