Apply patch that prevents a crash when more than

one event from a single event handler has been
   added in AddPendingEvents() and the event handler
   is destroyed before the pending events get sent.
   Sofar, only the first pointer to the event handler
   was removed which could lead to a crash.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33871 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2005-04-24 16:40:53 +00:00
parent f3ee029e05
commit 5d9d1b8810

View File

@@ -1044,8 +1044,10 @@ wxEvtHandler::~wxEvtHandler()
// Remove us from wxPendingEvents if necessary. // Remove us from wxPendingEvents if necessary.
if(wxPendingEventsLocker) if(wxPendingEventsLocker)
wxENTER_CRIT_SECT(*wxPendingEventsLocker); wxENTER_CRIT_SECT(*wxPendingEventsLocker);
if ( wxPendingEvents ) { if ( wxPendingEvents )
wxPendingEvents->DeleteObject(this); {
// Delete all occurences of this from the list of pending events
while (wxPendingEvents->DeleteObject(this)) { } // Do nothing
} }
if(wxPendingEventsLocker) if(wxPendingEventsLocker)
wxLEAVE_CRIT_SECT(*wxPendingEventsLocker); wxLEAVE_CRIT_SECT(*wxPendingEventsLocker);