GNOME Bugzilla – Bug 334027
Leaks in pygtype.c, pygenum.c
Last modified: 2006-09-29 19:11:13 UTC
The following functions have leaks: pyg_enum_new pyg_enum_from_gtype pyg_enum_add pyg_flags_new pyg_flags_from_gtype pyg_flags_add because they create PyIntObjects to use as keys for PyDicts, and then never unref them. I'll attach a patch (tested by running 'make check' in pygobject cvs, and by running a test program I wrote when tracking down this problem) to fix these problems. This problem was causing a slow - but significant - leak in flumotion, causing us to need to restart long-running processes every couple of days. It was actually pyg_flags_from_gtype causing the leak, the other 5 of these appear similar, however.
Created attachment 60980 [details] [review] Fix reported leaks
Thanks, committed. Btw, this got approval from the release team. Checking in ChangeLog; /cvs/gnome/gnome-python/pygobject/ChangeLog,v <-- ChangeLog new revision: 1.17; previous revision: 1.16 done Checking in gobject/pygenum.c; /cvs/gnome/gnome-python/pygobject/gobject/pygenum.c,v <-- pygenum.c new revision: 1.19; previous revision: 1.18 done Checking in gobject/pygflags.c; /cvs/gnome/gnome-python/pygobject/gobject/pygflags.c,v <-- pygflags.c new revision: 1.24; previous revision: 1.23 done
This bug is still in the copy of pygobject distributed with the new release of pygtk (0.8.5); it'd be great a future version of pygtk could come with a fixed pygobject. Please :-)
The future is already here, gobject is removed from pygtk in HEAD. I also committed the fix on the 2.8 branch right now.