diff options
author | Paul Pogonyshev <pogonyshev@gmx.net> | 2008-08-09 15:01:29 +0000 |
---|---|---|
committer | Paul Pogonyshev <paulp@src.gnome.org> | 2008-08-09 15:01:29 +0000 |
commit | 2a778d5bc55e812d549c02266d42b3f454627bd5 (patch) | |
tree | 7b54ef2c4d7220e685972fe6320205c32f7fdfe9 /gio/gfile.override | |
parent | 1a20d6e43a3cc24feb7d4d5573face04b6d2492a (diff) | |
download | pygobject-2a778d5bc55e812d549c02266d42b3f454627bd5.tar.gz pygobject-2a778d5bc55e812d549c02266d42b3f454627bd5.tar.xz pygobject-2a778d5bc55e812d549c02266d42b3f454627bd5.zip |
Bug 546591 – File.copy progress_callback does not work
2008-08-09 Paul Pogonyshev <pogonyshev@gmx.net>
Bug 546591 – File.copy progress_callback does not work
* gio/gfile.override (file_progress_callback_marshal): Use
PyObject_CallFunction() instead of PyEval_CallFunction(). Use "K"
instead of "k" (the latter is not correct for 32-bit platforms).
Don't free 'notify' here.
(_wrap_g_file_copy): Free 'notify'.
(_wrap_g_file_move): Likewise.
* gio/gio.override (pygio_free_notify): New function.
(async_result_callback_marshal): Use it.
* tests/test_gio.py (TestFile.test_copy_progress.progress): New
test.
svn path=/trunk/; revision=932
Diffstat (limited to 'gio/gfile.override')
-rw-r--r-- | gio/gfile.override | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/gio/gfile.override b/gio/gfile.override index cae5993..d7a40ee 100644 --- a/gio/gfile.override +++ b/gio/gfile.override @@ -33,12 +33,12 @@ file_progress_callback_marshal(goffset current_num_bytes, state = pyg_gil_state_ensure(); if (notify->data) - ret = PyEval_CallFunction(notify->callback, "(kkO)", - current_num_bytes, - total_num_bytes, - notify->data); + ret = PyObject_CallFunction(notify->callback, "(KKO)", + current_num_bytes, + total_num_bytes, + notify->data); else - ret = PyObject_CallFunction(notify->callback, "(kk)", + ret = PyObject_CallFunction(notify->callback, "(KK)", current_num_bytes, total_num_bytes); @@ -49,11 +49,6 @@ file_progress_callback_marshal(goffset current_num_bytes, } Py_XDECREF(ret); - - Py_DECREF(notify->callback); - Py_XDECREF(notify->data); - g_slice_free(PyGIONotify, notify); - pyg_gil_state_release(state); } %% @@ -577,6 +572,7 @@ _wrap_g_file_copy(PyGObject *self, notify, &error); + pygio_free_notify(notify); if (pyg_error_check(&error)) return NULL; @@ -647,6 +643,7 @@ _wrap_g_file_move(PyGObject *self, notify, &error); + pygio_free_notify(notify); if (pyg_error_check(&error)) return NULL; |