Parcourir la source

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

Sylvain il y a 2 ans
Parent
commit
0c048d98af
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  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;