diff --git a/src/video/x11/SDL_x11opengl.c b/src/video/x11/SDL_x11opengl.c index ab1bf58ca1..922c096173 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); }