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