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 546734 - missing Py_INCREFs for some file async methods
missing Py_INCREFs for some file async methods
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: gio
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: 2008-08-07 08:20 UTC by Jonathan Matthew
Modified: 2008-08-07 09:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
add missing refs (1.91 KB, patch)
2008-08-07 08:22 UTC, Jonathan Matthew
committed Details | Review

Description Jonathan Matthew 2008-08-07 08:20:37 UTC
_wrap_g_file_load_contents_async doesn't increment the refcounts of notify->callback and notify->data, so the objects tend to get garbage collected while the operation is in progress.  Adding Py_INCREF(notify->callback) and Py_XINCREF(notify->data) as seen in most other async method wrappers makes everything behave sanely.

I noticed this while trying to use file.load_contents_async, but it also affects a few other file async methods: append_to_async, create_async, replace_async, query_info_async.  I checked the other .override files and found no other async method wrappers that didn't increment these refcounts.
Comment 1 Jonathan Matthew 2008-08-07 08:22:48 UTC
Created attachment 116037 [details] [review]
add missing refs
Comment 2 Johan (not receiving bugmail) Dahlin 2008-08-07 09:21:15 UTC
Comment on attachment 116037 [details] [review]
add missing refs

Looks good, please commit
Comment 3 Jonathan Matthew 2008-08-07 09:45:59 UTC
2008-08-07  Jonathan Matthew  <jonathan@d14n.org>

        Bug 546734 – Missing Py_INCREFs for some file async methods

        * gio/gfile.override:
        Increment refcounts on callbacks and callback data for
        append_to_async, create_async, replace_async, query_info_async and
        load_contents_async as for all other async methods.
Comment 4 Gian Mario Tagliaretti 2008-08-07 09:50:30 UTC
wow... I've miss them all! sorry guys.