git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30949
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxENTER_CRIT_SECT( *m_eventsLocker);
#endif
wxENTER_CRIT_SECT( *m_eventsLocker);
#endif
+ // remember last event to process during this iteration
+ wxList::compatibility_iterator lastPendingNode = m_pendingEvents->GetLast();
+
wxList::compatibility_iterator node = m_pendingEvents->GetFirst();
while ( node )
{
wxList::compatibility_iterator node = m_pendingEvents->GetFirst();
while ( node )
{
wxENTER_CRIT_SECT( *m_eventsLocker);
#endif
wxENTER_CRIT_SECT( *m_eventsLocker);
#endif
+ // leave the loop once we have processed all events that were present
+ // at the start of ProcessPendingEvents because otherwise we could get
+ // into infinite loop if the pending event handler execution resulted
+ // in another event being posted
+ if ( node == lastPendingNode )
+ break;
+
node = m_pendingEvents->GetFirst();
}
node = m_pendingEvents->GetFirst();
}