Explorar el Código

Fixed crash when the current mouse capture window is destroyed

Fixes https://github.com/libsdl-org/SDL/issues/10494
Sam Lantinga hace 8 meses
padre
commit
91d97a367e
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      src/video/SDL_video.c

+ 3 - 0
src/video/SDL_video.c

@@ -4099,6 +4099,9 @@ void SDL_DestroyWindow(SDL_Window *window)
     if (SDL_GetKeyboardFocus() == window) {
         SDL_SetKeyboardFocus(NULL);
     }
+    if ((window->flags & SDL_WINDOW_MOUSE_CAPTURE)) {
+        SDL_UpdateMouseCapture(SDL_TRUE);
+    }
     if (SDL_GetMouseFocus() == window) {
         SDL_SetMouseFocus(NULL);
     }