pygobject r929 - in trunk: . gio



Author: jmatthew
Date: Thu Aug  7 09:45:50 2008
New Revision: 929
URL: http://svn.gnome.org/viewvc/pygobject?rev=929&view=rev

Log:
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.


Modified:
   trunk/ChangeLog
   trunk/gio/gfile.override

Modified: trunk/gio/gfile.override
==============================================================================
--- trunk/gio/gfile.override	(original)
+++ trunk/gio/gfile.override	Thu Aug  7 09:45:50 2008
@@ -236,6 +236,8 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]