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 334027 - Leaks in pygtype.c, pygenum.c
Leaks in pygtype.c, pygenum.c
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
2.8.0
Other All
: Normal critical
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2006-03-09 14:15 UTC by Michael Smith
Modified: 2006-09-29 19:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix reported leaks (3.91 KB, patch)
2006-03-09 14:15 UTC, Michael Smith
none Details | Review

Description Michael Smith 2006-03-09 14:15:29 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.
Comment 1 Michael Smith 2006-03-09 14:15:53 UTC
Created attachment 60980 [details] [review]
Fix reported leaks
Comment 2 Johan (not receiving bugmail) Dahlin 2006-03-09 20:22:40 UTC
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
Comment 3 Michael Smith 2006-04-05 11:03:40 UTC
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 :-)
Comment 4 Johan (not receiving bugmail) Dahlin 2006-04-05 11:30:44 UTC
The future is already here, gobject is removed from pygtk in HEAD.

I also committed the fix on the 2.8 branch right now.