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 741652 - Leaking menus when attaching to a button
Leaking menus when attaching to a button
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-12-17 14:02 UTC by Carlos Soriano
Modified: 2014-12-18 03:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gmenu: Track new menus and finalizes (1.07 KB, patch)
2014-12-17 14:02 UTC, Carlos Soriano
none Details | Review
testpopover: Test menu leaking (3.42 KB, patch)
2014-12-17 14:02 UTC, Carlos Soriano
none Details | Review

Description Carlos Soriano 2014-12-17 14:02:02 UTC
So creating menus from gtkbuilder and attaching them to a button
makes them inaccesible to be freed afterwards.
I expected setting the button model to NULL to freed them, but it's
not happening, and trying to unrefing the menu from outside gtkbuilder
only free the main menu, but not some children (which I guess they are 
ownership by the menu button and therefore not freed).
Attached are one patch for gmenu to count the number of created menus
and finalized menus.
The ohter patch is a hacked testpopover just to show the menu leak.
Comment 1 Carlos Soriano 2014-12-17 14:02:04 UTC
Created attachment 292899 [details] [review]
gmenu: Track new menus and finalizes
Comment 2 Carlos Soriano 2014-12-17 14:02:46 UTC
Created attachment 292902 [details] [review]
testpopover: Test menu leaking