]> git.saurik.com Git - wxWidgets.git/commitdiff
delete m_idleMutex later to avoid crashes if any windows are still left when the...
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 13 Nov 2007 00:15:53 +0000 (00:15 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 13 Nov 2007 00:15:53 +0000 (00:15 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49880 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/app.cpp

index 12b3f4dfdde251d48ddfc98236d6594df53f91f8..f530f0998c8c34894c98307aeb77bbd6ee6eb82c 100644 (file)
@@ -521,16 +521,21 @@ void wxApp::CleanUp()
 {
     if (m_idleSourceId != 0)
         g_source_remove(m_idleSourceId);
-#if wxUSE_THREADS
-    delete m_idleMutex;
-    m_idleMutex = NULL;
-#endif
+
     // release reference acquired by Initialize()
     g_type_class_unref(g_type_class_peek(GTK_TYPE_WIDGET));
 
     gdk_threads_leave();
 
     wxAppBase::CleanUp();
+
+    // delete this mutex as late as possible as it's used from WakeUpIdle(), in
+    // particular do it after calling the base class CleanUp() which can result
+    // in it being called
+#if wxUSE_THREADS
+    delete m_idleMutex;
+    m_idleMutex = NULL;
+#endif
 }
 
 void wxApp::WakeUpIdle()