From 9353e102dd7fd2386e232d3a9ee237511559e4df Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 7 Apr 2021 02:11:28 +0100 Subject: [PATCH] Catch exceptions from wxEVT_{QUERY_,}END_SESSION handlers too Similarly to the previous commit, call SafelyProcessEvent() to prevent the exceptions from escaping into MSW. See #19133. --- src/msw/window.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index be2685431d..eadc2f5700 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -4217,7 +4217,7 @@ bool wxWindowMSW::HandleQueryEndSession(long logOff, bool *mayEnd) event.SetCanVeto(true); event.SetLoggingOff(logOff == (long)ENDSESSION_LOGOFF); - bool rc = wxTheApp->ProcessEvent(event); + bool rc = wxTheApp->SafelyProcessEvent(event); if ( rc ) { @@ -4244,7 +4244,7 @@ bool wxWindowMSW::HandleEndSession(bool endSession, long logOff) event.SetCanVeto(false); event.SetLoggingOff((logOff & ENDSESSION_LOGOFF) != 0); - return wxTheApp->ProcessEvent(event); + return wxTheApp->SafelyProcessEvent(event); } // ---------------------------------------------------------------------------