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 688362 - GtkApplication: Fix memory leak
GtkApplication: Fix memory leak
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Class: GtkApplication
3.7.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-11-15 03:50 UTC by Andrew Potter
Modified: 2013-01-04 14:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GtkApplication: Fix memory leak in gtk_application_x11_publish_menu (731 bytes, patch)
2012-11-15 03:53 UTC, Andrew Potter
none Details | Review
GtkApplication: Properly unexport x11 menus (1.29 KB, patch)
2012-11-15 07:45 UTC, Andrew Potter
committed Details | Review

Description Andrew Potter 2012-11-15 03:50:41 UTC
GtkApplication leaks from an unfree()d g_strconcat() in gtk_application_x11_publish_menu().

Patch attached
Comment 1 Andrew Potter 2012-11-15 03:53:13 UTC
Created attachment 229021 [details] [review]
GtkApplication: Fix memory leak in gtk_application_x11_publish_menu
Comment 2 Andrew Potter 2012-11-15 06:33:19 UTC
Comment on attachment 229021 [details] [review]
GtkApplication: Fix memory leak in gtk_application_x11_publish_menu

The above patch breaks the app menu. I'm making a new patch to do the freeing in gtk_application_finalize()
Comment 3 Andrew Potter 2012-11-15 07:45:23 UTC
Created attachment 229024 [details] [review]
GtkApplication: Properly unexport x11 menus

This is a proper fix. I really tested it, I swear!

As a side effect of fixing the memory leak, MenuModels are now actually unexported at shutdown.
Comment 4 Allison Karlitskaya (desrt) 2012-11-15 16:04:49 UTC
Review of attachment 229024 [details] [review]:

This looks like fallout from the last time 'memory leaks' were fixed in this area of the code (and ended up causing crashes) -- it never got fixed again properly.
Comment 5 Sébastien Wilmet 2013-01-04 14:51:45 UTC
Comment on attachment 229024 [details] [review]
GtkApplication: Properly unexport x11 menus

Pushed to the master branch.