Commit 16c9bad78671713b20628eed0e3738d3429a5951

Sylvain 2023-03-28T09:49:45

Safety fix: clear "_this->wakeup_window" when destroying the window (cherry picked from commit c838ccf0e3a330ebbcf433698b8f5370c6fa80d6)

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 573b38f..ff50151 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -3276,6 +3276,10 @@ void SDL_DestroyWindow(SDL_Window *window)
         _this->current_glwin = NULL;
     }
 
+    if (_this->wakeup_window == window) {
+        _this->wakeup_window = NULL;
+    }
+
     /* Now invalidate magic */
     window->magic = NULL;