X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/55d99c7a77789ff4904bf96eddca3715eb5af9b9..2b5b932572d4386de0a1383982b96ef45c25ee05:/src/common/event.cpp diff --git a/src/common/event.cpp b/src/common/event.cpp index 7f36cc628b..b2dc2e82f4 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -656,6 +656,15 @@ wxEvtHandler::~wxEvtHandler() # if !defined(__VISAGECPP__) delete m_eventsLocker; # endif + + // Remove us from wxPendingEvents if necessary. + if(wxPendingEventsLocker) + wxENTER_CRIT_SECT(*wxPendingEventsLocker); + if ( wxPendingEvents ) { + wxPendingEvents->DeleteObject(this); + } + if(wxPendingEventsLocker) + wxLEAVE_CRIT_SECT(*wxPendingEventsLocker); #endif // we only delete object data, not untyped