X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cf2227623a889dd0a5f36288d346fc6bf64b55fa..77c8efc8c37da6d6a5e2e8022d21d1cd7d76371d:/src/common/event.cpp diff --git a/src/common/event.cpp b/src/common/event.cpp index 07e5fc3341..4bc7989682 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -1565,7 +1565,8 @@ bool wxEvtHandler::TryHereOnly(wxEvent& event) if ( GetEventHashTable().HandleEvent(event, this) ) return true; - // There is an implicit entry for async method calls procession in every +#ifdef wxHAS_CALL_AFTER + // There is an implicit entry for async method calls processing in every // event handler: if ( event.GetEventType() == wxEVT_ASYNC_METHOD_CALL && event.GetEventObject() == this ) @@ -1573,6 +1574,7 @@ bool wxEvtHandler::TryHereOnly(wxEvent& event) static_cast(event).Execute(); return true; } +#endif // wxHAS_CALL_AFTER // We don't have a handler for this event. return false; @@ -1673,15 +1675,6 @@ wxEvtHandler::DoUnbind(int id, if (!m_dynamicEvents) return false; - // Remove connection from tracker node (wxEventConnectionRef) - wxEvtHandler *eventSink = func.GetEvtHandler(); - if ( eventSink && eventSink != this ) - { - wxEventConnectionRef *evtConnRef = FindRefInTrackerList(eventSink); - if ( evtConnRef ) - evtConnRef->DecRef(); - } - wxList::compatibility_iterator node = m_dynamicEvents->GetFirst(); while (node) { @@ -1693,6 +1686,15 @@ wxEvtHandler::DoUnbind(int id, entry->m_fn->IsMatching(func) && ((entry->m_callbackUserData == userData) || !userData)) { + // Remove connection from tracker node (wxEventConnectionRef) + wxEvtHandler *eventSink = entry->m_fn->GetEvtHandler(); + if ( eventSink && eventSink != this ) + { + wxEventConnectionRef *evtConnRef = FindRefInTrackerList(eventSink); + if ( evtConnRef ) + evtConnRef->DecRef(); + } + delete entry->m_callbackUserData; m_dynamicEvents->Erase( node ); delete entry;