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 318684 - [PATCH] reference leaks when using PyList_Append to populate a list
[PATCH] reference leaks when using PyList_Append to populate a list
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-python
git master
Other Linux
: Normal normal
: 0.9.4
Assigned To: GStreamer Maintainers
Johan (not receiving bugmail) Dahlin
Depends on:
Blocks:
 
 
Reported: 2005-10-12 15:42 UTC by Alessandro Decina
Modified: 2005-10-13 10:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix (14.00 KB, patch)
2005-10-12 15:43 UTC, Alessandro Decina
none Details | Review

Description Alessandro Decina 2005-10-12 15:42:39 UTC
in gst-python PyList_Append is used to populate a list with newly created
objects. PyList_Append doesn't steal the reference of the new object. The
function provided by python to support that idiom is PyList_SetItem.
Comment 1 Alessandro Decina 2005-10-12 15:43:20 UTC
Created attachment 53374 [details] [review]
fix
Comment 2 Johan (not receiving bugmail) Dahlin 2005-10-12 16:26:51 UTC
Nice patch!

SetItem is also faster than Append, since you can allocate the whole list at once.
Comment 3 Edward Hervey 2005-10-13 10:59:22 UTC
phew, 3 patches in 3 days :) Keep on the good work.
Commited to cvs and closing bug