diff options
Diffstat (limited to 'src/demos/vertexBufferObject/VertexBufferObject.java')
-rw-r--r-- | src/demos/vertexBufferObject/VertexBufferObject.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/demos/vertexBufferObject/VertexBufferObject.java b/src/demos/vertexBufferObject/VertexBufferObject.java index 8a697f1..78e10a9 100644 --- a/src/demos/vertexBufferObject/VertexBufferObject.java +++ b/src/demos/vertexBufferObject/VertexBufferObject.java @@ -231,8 +231,15 @@ public class VertexBufferObject { frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { - animator.stop(); - System.exit(0); + // Run this on another thread than the AWT event queue to + // make sure the call to Animator.stop() completes before + // exiting + new Thread(new Runnable() { + public void run() { + animator.stop(); + System.exit(0); + } + }).start(); } }); |