]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/appbase.cpp
Take basic style into account when applying style sheet
[wxWidgets.git] / src / common / appbase.cpp
index 68ae29e35821adee26a75bde6657667dfe9d6071..209241a55b2a32d10922ebb23950decda3c5cca9 100644 (file)
@@ -359,21 +359,21 @@ void wxAppConsoleBase::ProcessPendingEvents()
 
     if (wxPendingEvents)
     {
-        // iterate until the list becomes empty
+        // 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)
         {
-            wxEvtHandler *handler = (wxEvtHandler *)node->GetData();
-            wxPendingEvents->Erase(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();
 
             wxENTER_CRIT_SECT( *wxPendingEventsLocker );
 
+            // restart as the iterators could have been invalidated
             node = wxPendingEvents->GetFirst();
         }
     }
@@ -645,13 +645,6 @@ void wxConsoleAppTraitsBase::RemoveFromPendingDelete(wxObject * WXUNUSED(object)
     // nothing to do
 }
 
-#if wxUSE_SOCKETS
-GSocketGUIFunctionsTable* wxConsoleAppTraitsBase::GetSocketGUIFunctionsTable()
-{
-    return NULL;
-}
-#endif
-
 // ----------------------------------------------------------------------------
 // wxAppTraits
 // ----------------------------------------------------------------------------
@@ -664,6 +657,31 @@ void wxAppTraitsBase::SetLocale()
 }
 #endif
 
+#if wxUSE_THREADS
+void wxMutexGuiEnterImpl();
+void wxMutexGuiLeaveImpl();
+
+void wxAppTraitsBase::MutexGuiEnter()
+{
+    wxMutexGuiEnterImpl();
+}
+
+void wxAppTraitsBase::MutexGuiLeave()
+{
+    wxMutexGuiLeaveImpl();
+}
+
+void WXDLLIMPEXP_BASE wxMutexGuiEnter()
+{
+    wxAppConsoleBase::GetInstance()->GetTraits()->MutexGuiEnter();
+}
+
+void WXDLLIMPEXP_BASE wxMutexGuiLeave()
+{
+    wxAppConsoleBase::GetInstance()->GetTraits()->MutexGuiLeave();
+}
+#endif // wxUSE_THREADS
+
 #ifdef __WXDEBUG__
 
 bool wxAppTraitsBase::ShowAssertDialog(const wxString& msgOriginal)