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 703973 - A GITypeInfo is leaked when setting user data for a callback
A GITypeInfo is leaked when setting user data for a callback
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
Git master
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2013-07-10 21:43 UTC by Mike Gorse
Modified: 2013-07-10 22:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch. (812 bytes, patch)
2013-07-10 21:59 UTC, Mike Gorse
committed Details | Review

Description Mike Gorse 2013-07-10 21:43:39 UTC
_args_cache_generate sometimes does not unref a GITypeInfo.

From make check.valgrind:

==21275== 10,080 (5,112 direct, 4,968 indirect) bytes in 71 blocks are definitely lost in loss record 19,803 of 19,938
==21275==    at 0x4C2C27B: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==21275==    by 0x80A3106: g_malloc (gmem.c:104)
==21275==    by 0x80BBCAF: g_slice_alloc (gslice.c:1016)
==21275==    by 0x86148A9: _g_info_new_full (gibaseinfo.c:61)
==21275==    by 0x861494E: g_info_new (gibaseinfo.c:80)
==21275==    by 0x8614BDE: _g_type_info_new (gibaseinfo.c:151)
==21275==    by 0x861478A: g_arg_info_get_type (giarginfo.c:307)
==21275==    by 0x83F69B4: _args_cache_generate (pygi-cache.c:1361)
==21275==    by 0x83F6EAB: _pygi_callable_cache_new (pygi-cache.c:1499)
==21275==    by 0x83F4629: _wrap_g_callable_info_invoke (pygi-invoke.c:680)
==21275==    by 0x4F0DF5C: PyEval_EvalFrameEx (in /usr/lib64/libpython3.3m.so.1.0)
==21275==    by 0x4F12520: PyEval_EvalCodeEx (in /usr/lib64/libpython3.3m.so.1.0)
Comment 1 Mike Gorse 2013-07-10 21:59:17 UTC
Created attachment 248882 [details] [review]
Patch.

Add a g_type_info_unref in the code path where it was missing.
Comment 2 Simon Feltman 2013-07-10 22:43:52 UTC
Looks good. Thank you.