-#if wxUSE_THREADS
- if ( !wxPendingEventsLocker )
- return;
-#endif
-
- wxENTER_CRIT_SECT( *wxPendingEventsLocker );
-
- if (wxPendingEvents)
- {
- // iterate until the list becomes empty: the handlers remove themselves
- // from it when they don't have any more pending events
- wxList::compatibility_iterator node = wxPendingEvents->GetFirst();
- while (node)
- {
- // In ProcessPendingEvents(), new handlers might be add
- // and we can safely leave the critical section here.
- wxLEAVE_CRIT_SECT( *wxPendingEventsLocker );
-
- wxEvtHandler *handler = (wxEvtHandler *)node->GetData();
- handler->ProcessPendingEvents();