]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/app.cpp
Context menu event from keyboard records the mouse position, not -1, -1,
[wxWidgets.git] / src / gtk / app.cpp
index 62cf72b0bed670e3d106b35b24af0c2461f80fa2..f530f0998c8c34894c98307aeb77bbd6ee6eb82c 100644 (file)
 #include "wx/gtk/private.h"
 #include "wx/apptrait.h"
 
+#if wxUSE_LIBHILDON
+    #include <hildon-widgets/hildon-program.h>
+#endif // wxUSE_LIBHILDON
+
 #include <gdk/gdkx.h>
 
 //-----------------------------------------------------------------------------
@@ -317,6 +321,15 @@ bool wxApp::OnInitGui()
         }
     }
 
+#if wxUSE_LIBHILDON
+    m_hildonProgram = hildon_program_get_instance();
+    if ( !m_hildonProgram )
+    {
+        wxLogError(_("Unable to initialize Hildon program"));
+        return false;
+    }
+#endif // wxUSE_LIBHILDON
+
     return true;
 }
 
@@ -508,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()