Don't unref the GtkBuilder when it's still needed
authorThomas White <taw@bitwiz.me.uk>
Sat, 31 Mar 2018 13:58:49 +0000 (15:58 +0200)
committerThomas White <taw@bitwiz.me.uk>
Sat, 31 Mar 2018 16:06:36 +0000 (18:06 +0200)
src/colloquium.c

index 4e99212..bcd3d92 100644 (file)
@@ -528,7 +528,6 @@ static void colloquium_startup(GApplication *papp)
 
        gtk_application_set_menubar(GTK_APPLICATION(app),
            G_MENU_MODEL(gtk_builder_get_object(builder, "menubar")));
-       g_object_unref(builder);
 
        settings = gtk_settings_get_for_screen(gdk_screen_get_default());
        g_object_get(G_OBJECT(settings), "gtk-shell-shows-app-menu", &app_menu_shown, NULL);
@@ -540,6 +539,7 @@ static void colloquium_startup(GApplication *papp)
                GMenuModel *mmodel = G_MENU_MODEL(gtk_builder_get_object(builder, "app-menu"));
                gtk_application_set_app_menu(GTK_APPLICATION(app), mmodel);
        }
+       g_object_unref(builder);
 
        configdir = g_get_user_config_dir();
        app->mydir = malloc(strlen(configdir)+14);