HumbleUI / JWM

Cross-platform window management and OS integration library for Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example segfaults on close on Linux

dzaima opened this issue · comments

The following fixes it:

diff --git a/examples/dashboard/java/Example.java b/examples/dashboard/java/Example.java
index ca847c9..bae392b 100644
--- a/examples/dashboard/java/Example.java
+++ b/examples/dashboard/java/Example.java
@@ -153,6 +153,7 @@ public class Example implements Consumer<Event> {
         if (e instanceof EventWindowClose) {
             if (App._windows.size() == 0)
                 App.terminate();
+            return;
         }
         
         panelTextInput.accept(e);

Does it not break on other OSes (should it not break)? Should there be some asserts to make sure you're not using things after termination?

Thanks! No it doesn’t crash on macOS, but the change makes perfect sense