commit ccd6bea24ab944cf0b5402d5117d2888d95305d9
Author: Andrew Potter <agpotter@gmail.com>
Date:   Wed Nov 14 23:27:41 2012 -0800

    GtkApplication: Properly unexport x11 menus
    
    Moves menubar involkation above NULLification of system_bus in
    gtk_application_shutdown_x11
    
    gtk_application_x11_publish_menu() requires the system_bus, and won't
    unexport any MenuModel if it is null. This also results in a memory
    leak in the local application because app_menu_path/menubar_path are
    never g_free()d.
    
    https://bugzilla.gnome.org//show_bug.cgi?id=688362

diff --git a/gtk/gtkapplication.c b/gtk/gtkapplication.c
index 4e9de42..084beae 100644
--- a/gtk/gtkapplication.c
+++ b/gtk/gtkapplication.c
@@ -289,12 +289,12 @@ gtk_application_startup_x11 (GtkApplication *application)
 static void
 gtk_application_shutdown_x11 (GtkApplication *application)
 {
-  application->priv->session_bus = NULL;
-  application->priv->object_path = NULL;
-
   gtk_application_set_app_menu_x11 (application, NULL);
   gtk_application_set_menubar_x11 (application, NULL);
 
+  application->priv->session_bus = NULL;
+  application->priv->object_path = NULL;
+
   g_clear_object (&application->priv->sm_proxy);
   g_clear_object (&application->priv->client_proxy);
   g_free (application->priv->app_id);
