From a3dda100f4355ca3a27fe2a40eb899df99685ea3 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 1 Sep 2017 14:00:11 -0400 Subject: [PATCH] x11: don't try to make a NULL GL context current when we already did that. --- src/video/x11/SDL_x11opengl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/video/x11/SDL_x11opengl.c b/src/video/x11/SDL_x11opengl.c index bf9a98e91..828a18d9f 100644 --- a/src/video/x11/SDL_x11opengl.c +++ b/src/video/x11/SDL_x11opengl.c @@ -452,7 +452,9 @@ X11_GL_InitExtensions(_THIS) if (context) { _this->gl_data->glXMakeCurrent(display, None, NULL); _this->gl_data->glXDestroyContext(display, context); - _this->gl_data->glXMakeCurrent(display, w, current_context); + if (current_context) { + _this->gl_data->glXMakeCurrent(display, w, current_context); + } } X11_XDestroyWindow(display, w);