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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user