From eb8ec6735aa4b69909110e2279bcdd7e13cb4fc1 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 8 Aug 2013 12:49:29 -0700 Subject: [PATCH] Send the SDL_QUIT when last window is destroyed, not during its close event. --- src/events/SDL_windowevents.c | 7 ------- src/video/SDL_video.c | 5 +++++ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/events/SDL_windowevents.c b/src/events/SDL_windowevents.c index 9011f68e1..b80afdc87 100644 --- a/src/events/SDL_windowevents.c +++ b/src/events/SDL_windowevents.c @@ -197,13 +197,6 @@ SDL_SendWindowEvent(SDL_Window * window, Uint8 windowevent, int data1, posted = (SDL_PushEvent(&event) > 0); } - if (windowevent == SDL_WINDOWEVENT_CLOSE) { - if ( !window->prev && !window->next ) { - /* This is the last window in the list so send the SDL_QUIT event */ - SDL_SendQuit(); - } - } - return (posted); } diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index bab6c6cb9..8acf3c6c5 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -2210,6 +2210,11 @@ SDL_DestroyWindow(SDL_Window * window) } SDL_free(window); + + if (_this->windows == NULL) { + /* This is the last window in the list so send the SDL_QUIT event */ + SDL_SendQuit(); + } } SDL_bool