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.
This commit is contained in:
Vadim Zeitlin
2021-04-07 02:11:28 +01:00
parent 44a37b5912
commit 9353e102dd

View File

@@ -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);
}
// ---------------------------------------------------------------------------