Commit b89cac6761e9ab48e1b6149a0da90d47baf6f925

Sven Hesse 2017-10-22T20:24:58

Don't X error in SDL_CreateWindow with unsupported GL attributes

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/src/video/x11/SDL_x11opengl.c b/src/video/x11/SDL_x11opengl.c
index ab1bf58..922c096 100644
--- a/src/video/x11/SDL_x11opengl.c
+++ b/src/video/x11/SDL_x11opengl.c
@@ -463,7 +463,9 @@ X11_GL_InitExtensions(_THIS)
         }
     }
 
-    X11_XDestroyWindow(display, w);
+    if (w) {
+        X11_XDestroyWindow(display, w);
+    }
     X11_PumpEvents(_this);
 }