From c114eb7a9fe8da830622db4e9be301e53734218d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 13 Nov 2007 00:15:53 +0000 Subject: [PATCH] delete m_idleMutex later to avoid crashes if any windows are still left when the application exits git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49880 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/app.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index 12b3f4dfdd..f530f0998c 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -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() -- 2.50.0