From 6b951024dcb3ba85e2d1dd042f1a8c60054277f5 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 30 Aug 2011 18:13:34 +0200 Subject: SWT/AWT Test: Run AWT destruction on AWT-EDT, issue shell.close() before shell.dispose() This fixes the _XSend X11 error on GLX commands using AMD driver .. proper cause unknown, but probably a race or condition or threading issue (Display usage by diff threads). --- .../jogamp/opengl/test/junit/jogl/swt/TestSWTAWT01GLn.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAWT01GLn.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAWT01GLn.java index db95f9660..2b12cdd23 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAWT01GLn.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAWT01GLn.java @@ -58,7 +58,7 @@ import com.jogamp.opengl.test.junit.util.UITestCase; /** * Tests that a basic SWT app can open without crashing under different GL profiles. Uses the AWT GL canvas with * the SWT_AWT bridge. - * @author Wade Walker + * @author Wade Walker, et.al. */ public class TestSWTAWT01GLn extends UITestCase { @@ -97,10 +97,14 @@ public class TestSWTAWT01GLn extends UITestCase { Assert.assertNotNull( composite ); Assert.assertNotNull( glcanvas ); try { - frame.setVisible( false ); - frame.remove( glcanvas ); - frame.dispose(); + javax.swing.SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + frame.setVisible(false); + frame.remove(glcanvas); + frame.dispose(); + }}); composite.dispose(); + shell.close(); shell.dispose(); display.dispose(); } -- cgit v1.2.3