Skip to content

Commit

Permalink
Fixed crash when the current mouse capture window is destroyed
Browse files Browse the repository at this point in the history
Fixes libsdl-org#10494

(cherry picked from commit 91d97a3)
  • Loading branch information
slouken committed Aug 7, 2024
1 parent 81252eb commit 5ca0639
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/video/SDL_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 5ca0639

Please sign in to comment.