After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 759132 - headerbar: Don't leak internal widgets
headerbar: Don't leak internal widgets
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 786975 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-12-07 16:47 UTC by Kalev Lember
Modified: 2017-08-31 15:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
headerbar: Don't leak internal widgets (2.23 KB, patch)
2015-12-07 16:47 UTC, Kalev Lember
committed Details | Review

Description Kalev Lember 2015-12-07 16:47:06 UTC
.
Comment 1 Kalev Lember 2015-12-07 16:47:34 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
Comment 2 Matthias Clasen 2015-12-07 17:42:57 UTC
> 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 ?
Comment 3 Kalev Lember 2015-12-07 18:10:51 UTC
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.
Comment 4 Daniel Boles 2017-08-31 15:35:29 UTC
*** Bug 786975 has been marked as a duplicate of this bug. ***