From 1512f0f7d88880cec7f716495a1d3d3d2b4fad65 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 27 Mar 2008 19:13:58 +0000 Subject: [PATCH] lock wxPendingEventsLocker when deleting the handler from wxPendingEvents (patch 1925946) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52860 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/event.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/common/event.cpp b/src/common/event.cpp index 69abfcc2bb..817f40e4a8 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -1187,7 +1187,17 @@ void wxEvtHandler::ProcessPendingEvents() // if there are no more pending events left, we don't need to stay in this // list if ( m_pendingEvents->IsEmpty() ) + { +#if wxUSE_THREADS + if (wxPendingEventsLocker) + wxENTER_CRIT_SECT(*wxPendingEventsLocker); +#endif wxPendingEvents->DeleteObject(this); +#if wxUSE_THREADS + if (wxPendingEventsLocker) + wxLEAVE_CRIT_SECT(*wxPendingEventsLocker); +#endif + } wxLEAVE_CRIT_SECT( m_pendingEventsLock ); -- 2.45.2