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 616786 - Correct the reference counting of userdata in closure handling
Correct the reference counting of userdata in closure handling
Status: RESOLVED FIXED
Product: pygi
Classification: Deprecated
Component: general
unspecified
Other All
: Normal normal
: 0.6
Assigned To: pygi-maint
pygi-maint
Depends on:
Blocks:
 
 
Reported: 2010-04-25 19:10 UTC by Zach Goldberg
Modified: 2010-04-26 16:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Correct the reference counting of userdata in closure handling (1.88 KB, patch)
2010-04-25 19:10 UTC, Zach Goldberg
committed Details | Review

Description Zach Goldberg 2010-04-25 19:10:21 UTC
Add a simple INCREF because PyTuple_SetItem steals a reference.  Also comes
with a test which demonstrates that we crashed before, and we work now.
Comment 1 Zach Goldberg 2010-04-25 19:10:23 UTC
Created attachment 159534 [details] [review]
Correct the reference counting of userdata in closure handling

Without this we lose references on every call and eventually end up free'ing objects
while they are still in use.
Comment 2 Tomeu Vizoso 2010-04-26 10:28:27 UTC
Review of attachment 159534 [details] [review]:

Sounds good, but I don't think we should be adding such a comment after every use of SetItem(). That info belongs to Python's API docs, not to the code that uses it.
Comment 3 Zach Goldberg 2010-04-26 16:49:03 UTC
Attachment 159534 [details] pushed as 8a0c48f - Correct the reference counting of userdata in closure handling