summaryrefslogtreecommitdiffstats
path: root/src/demos/vertexArrayRange/VertexArrayRange.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/demos/vertexArrayRange/VertexArrayRange.java')
-rw-r--r--src/demos/vertexArrayRange/VertexArrayRange.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/demos/vertexArrayRange/VertexArrayRange.java b/src/demos/vertexArrayRange/VertexArrayRange.java
index 825c668..3534c64 100644
--- a/src/demos/vertexArrayRange/VertexArrayRange.java
+++ b/src/demos/vertexArrayRange/VertexArrayRange.java
@@ -236,8 +236,15 @@ public class VertexArrayRange {
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();
}
});