GNOME Bugzilla – Bug 741652
Leaking menus when attaching to a button
Last modified: 2014-12-18 03:57:47 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.
Created attachment 292899 [details] [review] gmenu: Track new menus and finalizes
Created attachment 292902 [details] [review] testpopover: Test menu leaking