From 69ca977ccf8d329cd72dced5ebb92501da460561 Mon Sep 17 00:00:00 2001
From: Kenneth Russel <kbrussel@alum.mit.edu>
Date: Mon, 14 Feb 2005 22:19:43 +0000
Subject: Fixed problem in demos introduced in 1.1 b08 where windowClosing
 events were not properly waiting for the Animator to stop.

git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@55 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
---
 src/demos/tess/Tess.java | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

(limited to 'src/demos/tess/Tess.java')

diff --git a/src/demos/tess/Tess.java b/src/demos/tess/Tess.java
index f8f8213..4063367 100644
--- a/src/demos/tess/Tess.java
+++ b/src/demos/tess/Tess.java
@@ -77,8 +77,15 @@ public class Tess {
             final Animator animator = new Animator(canvas);
             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();
                 }
             });
             frame.show();
-- 
cgit v1.2.3