git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52860
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// 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 );