X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/923092017673fc1ff2408ec3f8f20d7b2f35cf0f..6a76384f2d9d70e209cbbefb8e59906603250641:/src/common/event.cpp diff --git a/src/common/event.cpp b/src/common/event.cpp index 29c728164f..b2dc2e82f4 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -5,7 +5,7 @@ // Modified by: // Created: 01/02/97 // RCS-ID: $Id$ -// Copyright: (c) Julian Smart and Markus Holzem +// Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -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