Fix handling exceptions from wxEVT_CHAR_HOOK handlers in wxMSW

Catch all the exceptions when processing this event from the keyboard
hook as they must not escape from it and outside of the application.

Closes #19133.
This commit is contained in:
Vadim Zeitlin
2021-04-07 02:08:48 +01:00
parent 1035ae27a7
commit 44a37b5912

View File

@@ -7184,7 +7184,9 @@ wxKeyboardHook(int nCode, WXWPARAM wParam, WXLPARAM lParam)
wxEvtHandler * const handler = win ? win->GetEventHandler()
: wxTheApp;
if ( handler && handler->ProcessEvent(event) )
// Do not let exceptions propagate out of the hook, it's a
// module boundary.
if ( handler && handler->SafelyProcessEvent(event) )
{
if ( !event.IsNextEventAllowed() )
{