GNOME Bugzilla – Bug 616786
Correct the reference counting of userdata in closure handling
Last modified: 2010-04-26 16:49:05 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.
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.
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.
Attachment 159534 [details] pushed as 8a0c48f - Correct the reference counting of userdata in closure handling