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 640184 - gobject.new-created objects never get finalized
gobject.new-created objects never get finalized
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: gobject
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: 2011-01-21 14:32 UTC by Steve Frécinaux
Modified: 2011-01-26 20:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add failing tests for the number of python refs at creation time (1.59 KB, patch)
2011-01-21 14:55 UTC, Steve Frécinaux
none Details | Review
Add some tests for the number of python refs held at creation time (1.45 KB, patch)
2011-01-21 17:43 UTC, Steve Frécinaux
committed Details | Review
Fix leaked python reference in python-defined subclasses (4.00 KB, patch)
2011-01-21 17:44 UTC, Steve Frécinaux
none Details | Review
Fix leaked python reference in python-defined subclasses (1.36 KB, patch)
2011-01-24 16:03 UTC, Steve Frécinaux
committed Details | Review

Description Steve Frécinaux 2011-01-21 14:32:27 UTC
When you create a python subclass for a gobject-based type (like a new GtkButton subclass) and instantiate it through gobject.new(MyNewButton), it will never get finalized because one python reference is leaked.

If the same object is created through MyNewButton(), then everything works as expected.
Comment 1 Steve Frécinaux 2011-01-21 14:55:40 UTC
Created attachment 178943 [details] [review]
Add failing tests for the number of python refs at creation time
Comment 2 Steve Frécinaux 2011-01-21 17:43:50 UTC
Created attachment 178977 [details] [review]
Add some tests for the number of python refs held at creation time
Comment 3 Steve Frécinaux 2011-01-21 17:44:03 UTC
Created attachment 178978 [details] [review]
Fix leaked python reference in python-defined subclasses
Comment 4 Steve Frécinaux 2011-01-24 16:03:10 UTC
Created attachment 179180 [details] [review]
Fix leaked python reference in python-defined subclasses

After running the test suite again it looks like nothing actually breaks.
Comment 5 johnp 2011-01-26 20:47:40 UTC
Attachment 178977 [details] pushed as a59e2d5 - Add some tests for the number of python refs held at creation time
Attachment 179180 [details] pushed as 975341a - Fix leaked python reference in python-defined subclasses