From 41ba53ca195b8c05ca5b4f01bf417d992adc6e1f Mon Sep 17 00:00:00 2001 From: Jonathan Matthew Date: Thu, 7 Aug 2008 09:45:50 +0000 Subject: Bug 546734 – Missing Py_INCREFs for some file async methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2008-08-07 Jonathan Matthew 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. svn path=/trunk/; revision=929 --- ChangeLog | 9 +++++++++ gio/gfile.override | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/ChangeLog b/ChangeLog index 58f1d8b..cc937e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-08-07 Jonathan Matthew + + 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. + 2008-08-06 Johan Dahlin * gio/gfile.override: diff --git a/gio/gfile.override b/gio/gfile.override index 24785b6..cae5993 100644 --- a/gio/gfile.override +++ b/gio/gfile.override @@ -236,6 +236,8 @@ _wrap_g_file_load_contents_async(PyGObject *self, if (!pygio_check_cancellable(pycancellable, &cancellable)) return NULL; + Py_INCREF(notify->callback); + Py_XINCREF(notify->data); g_file_load_contents_async(G_FILE(self->obj), cancellable, (GAsyncReadyCallback)async_result_callback_marshal, @@ -819,6 +821,8 @@ _wrap_g_file_append_to_async(PyGObject *self, PyObject *args, PyObject *kwargs) if (!pygio_check_cancellable(pycancellable, &cancellable)) return NULL; + Py_INCREF(notify->callback); + Py_XINCREF(notify->data); g_file_append_to_async(G_FILE(self->obj), flags, io_priority, cancellable, (GAsyncReadyCallback)async_result_callback_marshal, notify); @@ -862,6 +866,8 @@ _wrap_g_file_create_async(PyGObject *self, PyObject *args, PyObject *kwargs) if (!pygio_check_cancellable(pycancellable, &cancellable)) return NULL; + Py_INCREF(notify->callback); + Py_XINCREF(notify->data); g_file_create_async(G_FILE(self->obj), flags, io_priority, cancellable, (GAsyncReadyCallback)async_result_callback_marshal, notify); @@ -911,6 +917,8 @@ _wrap_g_file_replace_async(PyGObject *self, PyObject *args, PyObject *kwargs) if (!pygio_check_cancellable(pycancellable, &cancellable)) return NULL; + Py_INCREF(notify->callback); + Py_XINCREF(notify->data); g_file_replace_async(G_FILE(self->obj), etag, make_backup, flags, io_priority, cancellable, (GAsyncReadyCallback)async_result_callback_marshal, @@ -957,6 +965,8 @@ _wrap_g_file_query_info_async(PyGObject *self, PyObject *args, PyObject *kwargs) if (!pygio_check_cancellable(pycancellable, &cancellable)) return NULL; + Py_INCREF(notify->callback); + Py_XINCREF(notify->data); g_file_query_info_async(G_FILE(self->obj), attributes, flags, io_priority, cancellable, (GAsyncReadyCallback)async_result_callback_marshal, -- cgit