[gtk+] GtkApplicationWindow: Consistently unparent menubar



commit c7e72375598560e2b58c7658440df992d632e92d
Author: Colin Walters <walters verbum org>
Date:   Thu Dec 1 22:13:56 2011 -0500

    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 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkapplicationwindow.c b/gtk/gtkapplicationwindow.c
index 31b3d9d..68c39fd 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)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]