浏览代码

Safety fix: clear "_this->current_glwin" when destroying the window

Sylvain 2 年之前
父节点
当前提交
0c048d98af
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/video/SDL_video.c

+ 4 - 0
src/video/SDL_video.c

@@ -3458,6 +3458,10 @@ void SDL_DestroyWindow(SDL_Window *window)
         _this->grabbed_window = NULL; /* ungrabbing input. */
     }
 
+    if (_this->current_glwin == window) {
+        _this->current_glwin = NULL;
+    }
+
     /* Now invalidate magic */
     window->magic = NULL;