GNOME Bugzilla – Bug 759132
headerbar: Don't leak internal widgets
Last modified: 2017-08-31 15:35:29 UTC
.
Created attachment 316893 [details] [review] headerbar: Don't leak internal widgets Make sure to clean up internal widgets in destroy, as these aren't cleaned up when GtkContainer walks the childrens list in gtk_container_destroy(). This also fixes a gedit crash as reported in https://bugzilla.redhat.com/show_bug.cgi?id=1288669
> Make sure to clean up internal widgets in destroy, as these aren't > cleaned up when GtkContainer walks the childrens list in > gtk_container_destroy(). Why not ?
gtk_container_destroy uses gtk_container_foreach() for iterating over the children and that only iterates non-internal children. gtk_container_foreach() translates to gtk_header_bar_forall() with include_internals=FALSE, which carefully skips over the internal children. Other containers, such as https://git.gnome.org/browse/gtk+/tree/gtk/gtknotebook.c#n1775 are destroying internal children manually too.
*** Bug 786975 has been marked as a duplicate of this bug. ***