From c7e72375598560e2b58c7658440df992d632e92d Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 1 Dec 2011 22:13:56 -0500 Subject: [PATCH] GtkApplicationWindow: Consistently unparent menubar We create it floating, and don't hold an extra ref, so we should just unparent it. --- gtk/gtkapplicationwindow.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gtk/gtkapplicationwindow.c b/gtk/gtkapplicationwindow.c index 31b3d9dbd6..68c39fd0c6 100644 --- a/gtk/gtkapplicationwindow.c +++ b/gtk/gtkapplicationwindow.c @@ -87,7 +87,6 @@ gtk_application_window_update_menubar (GtkApplicationWindow *window) if (have_menubar && !should_have_menubar) { gtk_widget_unparent (window->priv->menubar); - g_object_unref (window->priv->menubar); window->priv->menubar = NULL; gtk_widget_queue_resize (GTK_WIDGET (window)); @@ -503,7 +502,11 @@ gtk_application_window_dispose (GObject *object) { GtkApplicationWindow *window = GTK_APPLICATION_WINDOW (object); - g_clear_object (&window->priv->menubar); + if (window->priv->menubar) + { + gtk_widget_unparent (window->priv->menubar); + window->priv->menubar = NULL; + } g_clear_object (&window->priv->actions); G_OBJECT_CLASS (gtk_application_window_parent_class)