Explorar o código

wayland: Free the cursors before stopping the event thread

An active cursor being destroyed may still have a frame callback referencing the thread queue, so clean it up before destroying the thread queue to ensure that no references to the queue remain when it is destroyed.
Frank Praznik hai 6 meses
pai
achega
168f78b8b7
Modificáronse 1 ficheiros con 5 adicións e 5 borrados
  1. 5 5
      src/video/wayland/SDL_waylandmouse.c

+ 5 - 5
src/video/wayland/SDL_waylandmouse.c

@@ -1492,17 +1492,17 @@ void Wayland_InitMouse(SDL_VideoData *data)
 
 
 void Wayland_FiniMouse(SDL_VideoData *data)
 void Wayland_FiniMouse(SDL_VideoData *data)
 {
 {
+    for (int i = 0; i < SDL_arraysize(sys_cursors); i++) {
+        Wayland_FreeCursor(sys_cursors[i]);
+        sys_cursors[i] = NULL;
+    }
+
     Wayland_DestroyCursorThread(data);
     Wayland_DestroyCursorThread(data);
     Wayland_FreeCursorThemes(data);
     Wayland_FreeCursorThemes(data);
 
 
 #ifdef SDL_USE_LIBDBUS
 #ifdef SDL_USE_LIBDBUS
     Wayland_DBusFinishCursorProperties();
     Wayland_DBusFinishCursorProperties();
 #endif
 #endif
-
-    for (int i = 0; i < SDL_arraysize(sys_cursors); i++) {
-        Wayland_FreeCursor(sys_cursors[i]);
-        sys_cursors[i] = NULL;
-    }
 }
 }
 
 
 void Wayland_SeatUpdatePointerCursor(SDL_WaylandSeat *seat)
 void Wayland_SeatUpdatePointerCursor(SDL_WaylandSeat *seat)