diff options
author | Matthias Clasen <mclasen@redhat.com> | 2012-07-10 21:24:10 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2012-07-10 21:25:58 -0400 |
commit | f7683b05b1c29ecc715715b95b2011a895917cf4 (patch) | |
tree | 1be8f9aa04d5ecfdcc9391741857dd950c2e4984 | |
parent | f3e7c06a826ef4dcb021e27a0198713c47d4b1de (diff) | |
download | gtk+-f7683b05b1c29ecc715715b95b2011a895917cf4.tar.gz |
GtkApplication: Fix unsetting menu models
Pointed out by Zachary Dovel in
http://bugzilla.gnome.org/show_bug.cgi?id=679705
-rw-r--r-- | gtk/gtkapplication.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gtk/gtkapplication.c b/gtk/gtkapplication.c index bd897d7271..efc1a8b486 100644 --- a/gtk/gtkapplication.c +++ b/gtk/gtkapplication.c @@ -79,7 +79,7 @@ * gtk_application_set_app_menu(). The #GMenuModel that this function * expects is usually constructed using #GtkBuilder, as seen in the * following example. To specify a menubar that will be shown by - * #GtkApplicationWindow<!-- -->s, use gtk_application_set_menubar(). Use the base + * #GtkApplicationWindows, use gtk_application_set_menubar(). Use the base * #GActionMap interface to add actions, to respond to the user * selecting these menu items. * @@ -1053,7 +1053,8 @@ gtk_application_set_app_menu (GtkApplication *application, if (application->priv->app_menu != NULL) g_object_ref (application->priv->app_menu); - extract_accels_from_menu (app_menu, application); + if (app_menu) + extract_accels_from_menu (app_menu, application); #ifdef GDK_WINDOWING_X11 gtk_application_set_app_menu_x11 (application, app_menu); @@ -1126,7 +1127,8 @@ gtk_application_set_menubar (GtkApplication *application, if (application->priv->menubar != NULL) g_object_ref (application->priv->menubar); - extract_accels_from_menu (menubar, application); + if (menubar) + extract_accels_from_menu (menubar, application); #ifdef GDK_WINDOWING_X11 gtk_application_set_menubar_x11 (application, menubar); |