X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8d7eaf91403705cdd94acaae0d7413e711cce3dc..3b38e2a022d97b2afae69cb5f322f96a6a0140f3:/src/common/event.cpp diff --git a/src/common/event.cpp b/src/common/event.cpp index 6da2424443..e0ea296ae2 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -1344,6 +1344,10 @@ bool wxEvtHandler::SearchDynamicEventTable( wxEvent& event ) wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->GetData(); #endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES + // get next node before (maybe) calling the event handler as it could + // call Disconnect() invalidating the current node + node = node->GetNext(); + if ((event.GetEventType() == entry->m_eventType) && (entry->m_fn != 0)) { wxEvtHandler *handler = @@ -1358,8 +1362,6 @@ bool wxEvtHandler::SearchDynamicEventTable( wxEvent& event ) return true; } } - - node = node->GetNext(); } return false;