summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT OpenGL/motif/org/eclipse/swt/opengl/GLCanvas.java
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT OpenGL/motif/org/eclipse/swt/opengl/GLCanvas.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT OpenGL/motif/org/eclipse/swt/opengl/GLCanvas.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT OpenGL/motif/org/eclipse/swt/opengl/GLCanvas.java b/bundles/org.eclipse.swt/Eclipse SWT OpenGL/motif/org/eclipse/swt/opengl/GLCanvas.java
index 8ab047b551..00d8eeb36b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT OpenGL/motif/org/eclipse/swt/opengl/GLCanvas.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT OpenGL/motif/org/eclipse/swt/opengl/GLCanvas.java
@@ -112,7 +112,10 @@ public GLCanvas (Composite parent, int style, GLData data) {
int xDisplay = OS.XtDisplay (handle);
int xScreen = OS.XDefaultScreen (xDisplay);
int infoPtr = GLX.glXChooseVisual (xDisplay, xScreen, glxAttrib);
- if (infoPtr == 0) SWT.error (SWT.ERROR_UNSUPPORTED_DEPTH);
+ if (infoPtr == 0) {
+ dispose ();
+ SWT.error (SWT.ERROR_UNSUPPORTED_DEPTH);
+ }
vinfo = new XVisualInfo ();
GLX.memmove (vinfo, infoPtr, XVisualInfo.sizeof);
OS.XFree (infoPtr);