Commit 6574e5eb57da52d9072a196af70e7406b8757a35

Sylvain 2023-03-28T09:48:58

Safety fix: clear "_this->current_glwin" when destroying the window (cherry picked from commit 0c048d98af449f1bc540e256c90eb792f1effff4)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index 7e77491..573b38f 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -3272,6 +3272,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;