From 8a6a7954c543e42082d895952342d46d45177737 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 17 Jul 2009 14:30:05 +0000 Subject: [PATCH] remove the event handler being deleted from pending events list (closes #10997) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@61438 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/event.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/event.cpp b/src/common/event.cpp index 2e6e46ba3e..25b9110c19 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -1087,14 +1087,18 @@ wxEvtHandler::~wxEvtHandler() // Remove us from wxPendingEvents if necessary. if(wxPendingEventsLocker) wxENTER_CRIT_SECT(*wxPendingEventsLocker); +#endif // wxUSE_THREADS + if ( wxPendingEvents ) { // Delete all occurences of this from the list of pending events while (wxPendingEvents->DeleteObject(this)) { } // Do nothing } + +#if wxUSE_THREADS if(wxPendingEventsLocker) wxLEAVE_CRIT_SECT(*wxPendingEventsLocker); -#endif +#endif // wxUSE_THREADS // we only delete object data, not untyped if ( m_clientDataType == wxClientData_Object )