diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index ab14c4f43..d3ba24957 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -3454,6 +3454,10 @@ void SDL_DestroyWindow(SDL_Window *window) _this->DestroyWindow(_this, window); } + if (_this->grabbed_window == window) { + _this->grabbed_window = NULL; /* ungrabbing input. */ + } + /* Now invalidate magic */ window->magic = NULL;