浏览代码

x11: don't try to make a NULL GL context current when we already did that.

Ryan C. Gordon 8 年之前
父节点
当前提交
a3dda100f4
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/video/x11/SDL_x11opengl.c

+ 3 - 1
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);