From 69518b9ecc1b987ce2962216289318fdd44ece46 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 29 Jul 2021 17:09:24 -0700 Subject: [PATCH] Make sure we don't send a resize event while a window is being destroyed This fixes https://github.com/libsdl-org/SDL/issues/3669 --- src/video/SDL_video.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index c13d47898..129eec4aa 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -2829,7 +2829,10 @@ void SDL_OnWindowResized(SDL_Window * window) { window->surface_valid = SDL_FALSE; - SDL_SendWindowEvent(window, SDL_WINDOWEVENT_SIZE_CHANGED, window->w, window->h); + + if (!window->is_destroying) { + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_SIZE_CHANGED, window->w, window->h); + } } void