[gtk+] headerbar: fix leak of start_box/end_box



commit 8ef4f7fd749bec85b2a6ec3602854fd769507c46
Author: Alan Jenkins <alan christopher jenkins gmail com>
Date:   Wed Oct 12 18:03:43 2016 +0100

    headerbar: fix leak of start_box/end_box
    
    gtk_widget_destroy() removes widgets from their container.  However
    _internal_ widgets must be unref'ed using gtk_widget_unparent() instead.
    This is symmetric with the fact that these widgets were ref'ed by direct
    call to gtk_widget_set_parent().  It's also the method that was used in
    gtk_headerbar_destroy().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=772859

 gtk/gtkheaderbar.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c
index 5154675..ce67c10 100644
--- a/gtk/gtkheaderbar.c
+++ b/gtk/gtkheaderbar.c
@@ -282,13 +282,13 @@ _gtk_header_bar_update_window_buttons (GtkHeaderBar *bar)
 
   if (priv->titlebar_start_box)
     {
-      gtk_widget_destroy (priv->titlebar_start_box);
+      gtk_widget_unparent (priv->titlebar_start_box);
       priv->titlebar_start_box = NULL;
       priv->titlebar_start_separator = NULL;
     }
   if (priv->titlebar_end_box)
     {
-      gtk_widget_destroy (priv->titlebar_end_box);
+      gtk_widget_unparent (priv->titlebar_end_box);
       priv->titlebar_end_box = NULL;
       priv->titlebar_end_separator = NULL;
     }


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