Don't let exceptions escape from events handled during idle time
This resulted in immediate program termination, at least with wxGTK, if an event handler called when dispatching pending events during idle time threw an exception (which, in particular, covers all the exceptions inside lambdas passed to CallAfter()). Just catch and handle them as usual, i.e. as we do with the event handlers called immediately in response to a user action.
This commit is contained in:
parent
cfb321b175
commit
a01c870dbb
1 changed files with 4 additions and 1 deletions
|
|
@ -1405,7 +1405,10 @@ void wxEvtHandler::ProcessPendingEvents()
|
|||
|
||||
wxLEAVE_CRIT_SECT( m_pendingEventsLock );
|
||||
|
||||
ProcessEvent(*event);
|
||||
// We must not let exceptions escape from here, there is no outer exception
|
||||
// handler to catch them and so letting them do it would just terminate the
|
||||
// program.
|
||||
SafelyProcessEvent(*event);
|
||||
|
||||
// careful: this object could have been deleted by the event handler
|
||||
// executed by the above ProcessEvent() call, so we can't access any fields
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue