소스 검색

Fixed crash when the current mouse capture window is destroyed

Fixes https://github.com/libsdl-org/SDL/issues/10494

(cherry picked from commit 91d97a367e9e15bb2067ed0594798dc54c862bb1)
Sam Lantinga 1 년 전
부모
커밋
5ca0639a42
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      src/video/SDL_video.c

+ 3 - 0
src/video/SDL_video.c

@@ -3312,6 +3312,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);
     }