Commit 006378b9213e3e04ea2b9c591afe2a44e75e6867

Christian Rauch 2021-05-02T18:30:32

fix NULL frame_callback access

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c
index fb7f897..a6ff2fb 100644
--- a/src/video/wayland/SDL_waylandwindow.c
+++ b/src/video/wayland/SDL_waylandwindow.c
@@ -1223,7 +1223,9 @@ void Wayland_DestroyWindow(_THIS, SDL_Window *window)
 
         SDL_free(wind->outputs);
 
-        wl_callback_destroy(wind->frame_callback);
+        if (wind->frame_callback) {
+            wl_callback_destroy(wind->frame_callback);
+        }
 
 #ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
         if (wind->extended_surface) {