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 690532 - memory leak when registering enum types
memory leak when registering enum types
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
Git master
Other Linux
: Normal minor
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2012-12-20 01:48 UTC by Mike Gorse
Modified: 2012-12-20 08:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch. (1.46 KB, patch)
2012-12-20 01:52 UTC, Mike Gorse
none Details | Review

Description Mike Gorse 2012-12-20 01:48:54 UTC
When registering enum or flag types, we first dup the string, but this is not necessary. G_flags_register_static and g_enum_register_static call g_type_register_static, which eventually calls type_node_any_new_W, which passes the type name to g_quark_from_string, which itself dups the string if needed, resulting in a small leak.
Comment 1 Mike Gorse 2012-12-20 01:52:53 UTC
Created attachment 231944 [details] [review]
Patch.
Comment 2 Martin Pitt 2012-12-20 08:53:37 UTC
Thank you! Applied.