Terminate background thread when closing window without pressing Escape

This avoids a zombie thread with no UI from which to receive keyboard input when the window is closed before pressing <Esc>.
This commit is contained in:
David Hall
2023-01-07 05:53:16 -05:00
parent 1aad27e011
commit 58e8505660

View File

@@ -68,7 +68,7 @@ public class Renderer implements GLEventListener {
}
}
stopped = keyboard.isPressed(KeyEvent.VK_ESCAPE);
stopped |= keyboard.isPressed(KeyEvent.VK_ESCAPE);
}
Renderer.this.glWindow.destroy();
@@ -112,6 +112,7 @@ public class Renderer implements GLEventListener {
@Override
public void dispose(GLAutoDrawable drawable) {
stop();
explosionComputeHandler.dispose();
}