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 #10494
  • Loading branch information
slouken committed Aug 7, 2024
1 parent 212f7cc commit 91d97a3
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 @@ -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);
}
Expand Down

0 comments on commit 91d97a3

Please sign in to comment.