forked from AuroraMiddleware/gtk
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
This commit is contained in:
parent
8aa9339b2d
commit
8ef4f7fd74
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user