summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2018-02-13 23:26:03 +0100
committerChristoph Reiter <reiter.christoph@gmail.com>2018-02-13 22:32:44 +0000
commitfa555767464fbe551b14cfbc121febc5290b1371 (patch)
treea9a6f06b2116017abe8d925f479da9884e3a97bb
parent10c062001ddd948b0a70545cbf613b38ed6fa46c (diff)
downloadpygobject-fa555767464fbe551b14cfbc121febc5290b1371.tar.gz
Revert "to python marshalling: collect cleanup data"
This reverts commit 80eab029ce4e181624d7b845a4b517051797080d.
-rw-r--r--gi/pygi-array.c24
-rw-r--r--gi/pygi-basictype.c8
-rw-r--r--gi/pygi-basictype.h3
-rw-r--r--gi/pygi-cache.h13
-rw-r--r--gi/pygi-closure.c9
-rw-r--r--gi/pygi-enum-marshal.c6
-rw-r--r--gi/pygi-error.c3
-rw-r--r--gi/pygi-hashtable.c13
-rw-r--r--gi/pygi-invoke-state-struct.h3
-rw-r--r--gi/pygi-invoke.c17
-rw-r--r--gi/pygi-list.c38
-rw-r--r--gi/pygi-marshal-cleanup.c13
-rw-r--r--gi/pygi-object.c8
-rw-r--r--gi/pygi-struct-marshal.c5
14 files changed, 43 insertions, 120 deletions
diff --git a/gi/pygi-array.c b/gi/pygi-array.c
index 0f6c6d8d..e55f9f6c 100644
--- a/gi/pygi-array.c
+++ b/gi/pygi-array.c
@@ -505,8 +505,7 @@ static PyObject *
_pygi_marshal_to_py_array (PyGIInvokeState *state,
PyGICallableCache *callable_cache,
PyGIArgCache *arg_cache,
- GIArgument *arg,
- gpointer *cleanup_data)
+ GIArgument *arg)
{
GArray *array_;
PyObject *py_obj = NULL;
@@ -576,14 +575,11 @@ _pygi_marshal_to_py_array (PyGIInvokeState *state,
gsize item_size;
PyGIMarshalToPyFunc item_to_py_marshaller;
PyGIArgCache *item_arg_cache;
- GPtrArray *item_cleanups;
py_obj = PyList_New (array_->len);
if (py_obj == NULL)
goto err;
- item_cleanups = g_ptr_array_sized_new (array_->len);
- *cleanup_data = item_cleanups;
item_arg_cache = seq_cache->item_cache;
item_to_py_marshaller = item_arg_cache->to_py_marshaller;
@@ -593,7 +589,6 @@ _pygi_marshal_to_py_array (PyGIInvokeState *state,
for (i = 0; i < array_->len; i++) {
GIArgument item_arg = {0};
PyObject *py_item;
- gpointer item_cleanup_data = NULL;
/* If we are receiving an array of pointers, simply assign the pointer
* and move on, letting the per-item marshaler deal with the
@@ -637,10 +632,7 @@ _pygi_marshal_to_py_array (PyGIInvokeState *state,
py_item = item_to_py_marshaller ( state,
callable_cache,
item_arg_cache,
- &item_arg,
- &item_cleanup_data);
-
- g_ptr_array_index (item_cleanups, i) = item_cleanup_data;
+ &item_arg);
if (py_item == NULL) {
Py_CLEAR (py_obj);
@@ -648,8 +640,6 @@ _pygi_marshal_to_py_array (PyGIInvokeState *state,
if (array_cache->array_type == GI_ARRAY_TYPE_C)
g_array_unref (array_);
- g_ptr_array_unref (item_cleanups);
-
goto err;
}
PyList_SET_ITEM (py_obj, i, py_item);
@@ -670,7 +660,7 @@ err:
/* clean up unprocessed items */
if (seq_cache->item_cache->to_py_cleanup != NULL) {
guint j;
- PyGIMarshalToPyCleanupFunc cleanup_func = seq_cache->item_cache->to_py_cleanup;
+ PyGIMarshalCleanupFunc cleanup_func = seq_cache->item_cache->to_py_cleanup;
for (j = processed_items; j < array_->len; j++) {
cleanup_func (state,
seq_cache->item_cache,
@@ -721,7 +711,7 @@ _wrap_c_array (PyGIInvokeState *state,
static void
_pygi_marshal_cleanup_to_py_array (PyGIInvokeState *state,
PyGIArgCache *arg_cache,
- gpointer cleanup_data,
+ PyObject *dummy,
gpointer data,
gboolean was_processed)
{
@@ -747,19 +737,17 @@ _pygi_marshal_cleanup_to_py_array (PyGIInvokeState *state,
}
if (sequence_cache->item_cache->to_py_cleanup != NULL) {
- GPtrArray *item_cleanups = (GPtrArray *) cleanup_data;
gsize i;
guint len = (array_ != NULL) ? array_->len : ptr_array_->len;
- PyGIMarshalToPyCleanupFunc cleanup_func = sequence_cache->item_cache->to_py_cleanup;
+ PyGIMarshalCleanupFunc cleanup_func = sequence_cache->item_cache->to_py_cleanup;
for (i = 0; i < len; i++) {
cleanup_func (state,
sequence_cache->item_cache,
- g_ptr_array_index(item_cleanups, i),
+ NULL,
(array_ != NULL) ? g_array_index (array_, gpointer, i) : g_ptr_array_index (ptr_array_, i),
was_processed);
}
- g_ptr_array_unref (item_cleanups);
}
if (array_ != NULL)
diff --git a/gi/pygi-basictype.c b/gi/pygi-basictype.c
index ddb02f9b..6d4e64ef 100644
--- a/gi/pygi-basictype.c
+++ b/gi/pygi-basictype.c
@@ -684,8 +684,7 @@ static PyObject *
_pygi_marshal_to_py_void (PyGIInvokeState *state,
PyGICallableCache *callable_cache,
PyGIArgCache *arg_cache,
- GIArgument *arg,
- gpointer *cleanup_data)
+ GIArgument *arg)
{
if (arg_cache->is_pointer) {
return PyLong_FromVoidPtr (arg->v_pointer);
@@ -829,8 +828,7 @@ PyObject *
_pygi_marshal_to_py_basic_type_cache_adapter (PyGIInvokeState *state,
PyGICallableCache *callable_cache,
PyGIArgCache *arg_cache,
- GIArgument *arg,
- gpointer *cleanup_data)
+ GIArgument *arg)
{
return _pygi_marshal_to_py_basic_type (arg,
arg_cache->type_tag,
@@ -840,7 +838,7 @@ _pygi_marshal_to_py_basic_type_cache_adapter (PyGIInvokeState *state,
static void
_pygi_marshal_cleanup_to_py_utf8 (PyGIInvokeState *state,
PyGIArgCache *arg_cache,
- gpointer cleanup_data,
+ PyObject *dummy,
gpointer data,
gboolean was_processed)
{
diff --git a/gi/pygi-basictype.h b/gi/pygi-basictype.h
index 62f11c6f..466c7d4a 100644
--- a/gi/pygi-basictype.h
+++ b/gi/pygi-basictype.h
@@ -43,8 +43,7 @@ PyObject *_pygi_marshal_to_py_basic_type (GIArgument *arg,
PyObject *_pygi_marshal_to_py_basic_type_cache_adapter (PyGIInvokeState *state,
PyGICallableCache *callable_cache,
PyGIArgCache *arg_cache,
- GIArgument *arg,
- gpointer *cleanup_data);
+ GIArgument *arg);
PyGIArgCache *pygi_arg_basic_type_new_from_info (GITypeInfo *type_info,
GIArgInfo *arg_info, /* may be null */
diff --git a/gi/pygi-cache.h b/gi/pygi-cache.h
index 574563b6..4dfabd86 100644
--- a/gi/pygi-cache.h
+++ b/gi/pygi-cache.h
@@ -50,21 +50,14 @@ typedef gboolean (*PyGIMarshalFromPyFunc) (PyGIInvokeState *state,
typedef PyObject *(*PyGIMarshalToPyFunc) (PyGIInvokeState *state,
PyGICallableCache *callable_cache,
PyGIArgCache *arg_cache,
- GIArgument *arg,
- gpointer *cleanup_data);
+ GIArgument *arg);
typedef void (*PyGIMarshalCleanupFunc) (PyGIInvokeState *state,
PyGIArgCache *arg_cache,
- PyObject *py_arg,
+ PyObject *py_arg, /* always NULL for to_py cleanup */
gpointer data,
gboolean was_processed);
-typedef void (*PyGIMarshalToPyCleanupFunc) (PyGIInvokeState *state,
- PyGIArgCache *arg_cache,
- gpointer cleanup_data,
- gpointer data,
- gboolean was_processed);
-
/* Argument meta types denote how we process the argument:
* - PYGI_META_ARG_TYPE_PARENT - parents may or may not have children
* but are always processed via the normal marshaller for their
@@ -125,7 +118,7 @@ struct _PyGIArgCache
PyGIMarshalToPyFunc to_py_marshaller;
PyGIMarshalCleanupFunc from_py_cleanup;
- PyGIMarshalToPyCleanupFunc to_py_cleanup;
+ PyGIMarshalCleanupFunc to_py_cleanup;
GDestroyNotify destroy_notify;
diff --git a/gi/pygi-closure.c b/gi/pygi-closure.c
index 42144e07..b51c04c5 100644
--- a/gi/pygi-closure.c
+++ b/gi/pygi-closure.c
@@ -393,14 +393,10 @@ _pygi_closure_convert_arguments (PyGIInvokeState *state,
} else if (arg_cache->meta_type != PYGI_META_ARG_TYPE_PARENT) {
continue;
} else {
- gpointer cleanup_data = NULL;
-
value = arg_cache->to_py_marshaller (state,
cache,
arg_cache,
- &state->args[i].arg_value,
- &cleanup_data);
- state->args[i].to_py_arg_cleanup_data = cleanup_data;
+ &state->args[i].arg_value);
if (value == NULL) {
pygi_marshal_cleanup_args_to_py_parameter_fail (state,
@@ -804,8 +800,7 @@ static PyObject *
_pygi_marshal_to_py_interface_callback (PyGIInvokeState *state,
PyGICallableCache *callable_cache,
PyGIArgCache *arg_cache,
- GIArgument *arg,
- gpointer *arg_cleanup_data)
+ GIArgument *arg)
{
PyGICallbackCache *callback_cache = (PyGICallbackCache *) arg_cache;
gssize user_data_index;
diff --git a/gi/pygi-enum-marshal.c b/gi/pygi-enum-marshal.c
index fe6c7d72..44eb0097 100644
--- a/gi/pygi-enum-marshal.c
+++ b/gi/pygi-enum-marshal.c
@@ -225,8 +225,7 @@ static PyObject *
_pygi_marshal_to_py_interface_enum (PyGIInvokeState *state,
PyGICallableCache *callable_cache,
PyGIArgCache *arg_cache,
- GIArgument *arg,
- gpointer *cleanup_data)
+ GIArgument *arg)
{
PyObject *py_obj = NULL;
PyGIInterfaceCache *iface_cache = (PyGIInterfaceCache *)arg_cache;
@@ -254,8 +253,7 @@ static PyObject *
_pygi_marshal_to_py_interface_flags (PyGIInvokeState *state,
PyGICallableCache *callable_cache,
PyGIArgCache *arg_cache,
- GIArgument *arg,
- gpointer *cleanup_data)
+ GIArgument *arg)
{
PyObject *py_obj = NULL;
PyGIInterfaceCache *iface_cache = (PyGIInterfaceCache *)arg_cache;
diff --git a/gi/pygi-error.c b/gi/pygi-error.c
index 4827e9f4..e3d88384 100644
--- a/gi/pygi-error.c
+++ b/gi/pygi-error.c
@@ -275,8 +275,7 @@ static PyObject *
_pygi_marshal_to_py_gerror (PyGIInvokeState *state,
PyGICallableCache *callable_cache,
PyGIArgCache *arg_cache,
- GIArgument *arg,
- gpointer *cleanup_data)
+ GIArgument *arg)
{
GError *error = arg->v_pointer;
PyObject *py_obj = NULL;
diff --git a/gi/pygi-hashtable.c b/gi/pygi-hashtable.c
index f0cda78f..647bf04d 100644
--- a/gi/pygi-hashtable.c
+++ b/gi/pygi-hashtable.c
@@ -220,8 +220,7 @@ static PyObject *
_pygi_marshal_to_py_ghash (PyGIInvokeState *state,
PyGICallableCache *callable_cache,
PyGIArgCache *arg_cache,
- GIArgument *arg,
- gpointer *cleanup_data)
+ GIArgument *arg)
{
GHashTable *hash_;
GHashTableIter hash_table_iter;
@@ -260,8 +259,6 @@ _pygi_marshal_to_py_ghash (PyGIInvokeState *state,
while (g_hash_table_iter_next (&hash_table_iter,
&key_arg.v_pointer,
&value_arg.v_pointer)) {
- gpointer key_cleanup_data = NULL;
- gpointer value_cleanup_data = NULL;
PyObject *py_key;
PyObject *py_value;
int retval;
@@ -271,8 +268,7 @@ _pygi_marshal_to_py_ghash (PyGIInvokeState *state,
py_key = key_to_py_marshaller ( state,
callable_cache,
key_arg_cache,
- &key_arg,
- &key_cleanup_data);
+ &key_arg);
if (py_key == NULL) {
Py_CLEAR (py_obj);
@@ -283,8 +279,7 @@ _pygi_marshal_to_py_ghash (PyGIInvokeState *state,
py_value = value_to_py_marshaller ( state,
callable_cache,
value_arg_cache,
- &value_arg,
- &value_cleanup_data);
+ &value_arg);
if (py_value == NULL) {
Py_CLEAR (py_obj);
@@ -309,7 +304,7 @@ _pygi_marshal_to_py_ghash (PyGIInvokeState *state,
static void
_pygi_marshal_cleanup_to_py_ghash (PyGIInvokeState *state,
PyGIArgCache *arg_cache,
- gpointer cleanup_data,
+ PyObject *dummy,
gpointer data,
gboolean was_processed)
{
diff --git a/gi/pygi-invoke-state-struct.h b/gi/pygi-invoke-state-struct.h
index dbf4e665..64711cb1 100644
--- a/gi/pygi-invoke-state-struct.h
+++ b/gi/pygi-invoke-state-struct.h
@@ -20,8 +20,6 @@ typedef struct _PyGIInvokeArgState
/* Holds from_py marshaler cleanup data. */
gpointer arg_cleanup_data;
- /* Holds to_py marshaler cleanup data. */
- gpointer to_py_arg_cleanup_data;
} PyGIInvokeArgState;
@@ -47,7 +45,6 @@ typedef struct _PyGIInvokeState
/* Memory to receive the result of the C ffi function call. */
GIArgument return_arg;
- gpointer to_py_return_arg_cleanup_data;
/* A GError exception which is indirectly bound into the last position of
* the "args" array if the callable caches "throws" member is set.
diff --git a/gi/pygi-invoke.c b/gi/pygi-invoke.c
index fca48bae..fd9e4746 100644
--- a/gi/pygi-invoke.c
+++ b/gi/pygi-invoke.c
@@ -565,13 +565,10 @@ _invoke_marshal_out_args (PyGIInvokeState *state, PyGIFunctionCache *function_ca
if (cache->return_cache) {
if (!cache->return_cache->is_skipped) {
- gpointer cleanup_data = NULL;
py_return = cache->return_cache->to_py_marshaller ( state,
cache,
cache->return_cache,
- &state->return_arg,
- &cleanup_data);
- state->to_py_return_arg_cleanup_data = cleanup_data;
+ &state->return_arg);
if (py_return == NULL) {
pygi_marshal_cleanup_args_return_fail (state,
cache);
@@ -579,7 +576,7 @@ _invoke_marshal_out_args (PyGIInvokeState *state, PyGIFunctionCache *function_ca
}
} else {
if (cache->return_cache->transfer == GI_TRANSFER_EVERYTHING) {
- PyGIMarshalToPyCleanupFunc to_py_cleanup =
+ PyGIMarshalCleanupFunc to_py_cleanup =
cache->return_cache->to_py_cleanup;
if (to_py_cleanup != NULL)
@@ -607,13 +604,10 @@ _invoke_marshal_out_args (PyGIInvokeState *state, PyGIFunctionCache *function_ca
} else if (!cache->has_return && n_out_args == 1) {
/* if we get here there is one out arg an no return */
PyGIArgCache *arg_cache = (PyGIArgCache *)cache->to_py_args->data;
- gpointer cleanup_data = NULL;
py_out = arg_cache->to_py_marshaller (state,
cache,
arg_cache,
- state->args[arg_cache->c_arg_index].arg_pointer.v_pointer,
- &cleanup_data);
- state->args[arg_cache->c_arg_index].to_py_arg_cleanup_data = cleanup_data;
+ state->args[arg_cache->c_arg_index].arg_pointer.v_pointer);
if (py_out == NULL) {
pygi_marshal_cleanup_args_to_py_parameter_fail (state,
cache,
@@ -643,13 +637,10 @@ _invoke_marshal_out_args (PyGIInvokeState *state, PyGIFunctionCache *function_ca
for (; py_arg_index < tuple_len; py_arg_index++) {
PyGIArgCache *arg_cache = (PyGIArgCache *)cache_item->data;
- gpointer cleanup_data = NULL;
PyObject *py_obj = arg_cache->to_py_marshaller (state,
cache,
arg_cache,
- state->args[arg_cache->c_arg_index].arg_pointer.v_pointer,
- &cleanup_data);
- state->args[arg_cache->c_arg_index].to_py_arg_cleanup_data = cleanup_data;
+ state->args[arg_cache->c_arg_index].arg_pointer.v_pointer);
if (py_obj == NULL) {
if (cache->has_return)
diff --git a/gi/pygi-list.c b/gi/pygi-list.c
index e9fc92ca..72a3d205 100644
--- a/gi/pygi-list.c
+++ b/gi/pygi-list.c
@@ -234,13 +234,11 @@ static PyObject *
_pygi_marshal_to_py_glist (PyGIInvokeState *state,
PyGICallableCache *callable_cache,
PyGIArgCache *arg_cache,
- GIArgument *arg,
- gpointer *cleanup_data)
+ GIArgument *arg)
{
GList *list_;
gsize length;
gsize i;
- GPtrArray *item_cleanups;
PyGIMarshalToPyFunc item_to_py_marshaller;
PyGIArgCache *item_arg_cache;
@@ -255,31 +253,23 @@ _pygi_marshal_to_py_glist (PyGIInvokeState *state,
if (py_obj == NULL)
return NULL;
- item_cleanups = g_ptr_array_sized_new (length);
- *cleanup_data = item_cleanups;
-
item_arg_cache = seq_cache->item_cache;
item_to_py_marshaller = item_arg_cache->to_py_marshaller;
for (i = 0; list_ != NULL; list_ = g_list_next (list_), i++) {
GIArgument item_arg;
PyObject *py_item;
- gpointer item_cleanup_data = NULL;
item_arg.v_pointer = list_->data;
_pygi_hash_pointer_to_arg (&item_arg, item_arg_cache->type_info);
py_item = item_to_py_marshaller (state,
callable_cache,
item_arg_cache,
- &item_arg,
- &item_cleanup_data);
-
- g_ptr_array_index (item_cleanups, i) = item_cleanup_data;
+ &item_arg);
if (py_item == NULL) {
Py_CLEAR (py_obj);
_PyGI_ERROR_PREFIX ("Item %zu: ", i);
- g_ptr_array_unref (item_cleanups);
return NULL;
}
@@ -293,13 +283,11 @@ static PyObject *
_pygi_marshal_to_py_gslist (PyGIInvokeState *state,
PyGICallableCache *callable_cache,
PyGIArgCache *arg_cache,
- GIArgument *arg,
- gpointer *cleanup_data)
+ GIArgument *arg)
{
GSList *list_;
gsize length;
gsize i;
- GPtrArray *item_cleanups;
PyGIMarshalToPyFunc item_to_py_marshaller;
PyGIArgCache *item_arg_cache;
@@ -314,30 +302,23 @@ _pygi_marshal_to_py_gslist (PyGIInvokeState *state,
if (py_obj == NULL)
return NULL;
- item_cleanups = g_ptr_array_sized_new (length);
- *cleanup_data = item_cleanups;
-
item_arg_cache = seq_cache->item_cache;
item_to_py_marshaller = item_arg_cache->to_py_marshaller;
for (i = 0; list_ != NULL; list_ = g_slist_next (list_), i++) {
GIArgument item_arg;
PyObject *py_item;
- gpointer item_cleanup_data = NULL;
item_arg.v_pointer = list_->data;
_pygi_hash_pointer_to_arg (&item_arg, item_arg_cache->type_info);
py_item = item_to_py_marshaller (state,
callable_cache,
item_arg_cache,
- &item_arg,
- &item_cleanup_data);
+ &item_arg);
- g_ptr_array_index (item_cleanups, i) = item_cleanup_data;
if (py_item == NULL) {
Py_CLEAR (py_obj);
_PyGI_ERROR_PREFIX ("Item %zu: ", i);
- g_ptr_array_unref (item_cleanups);
return NULL;
}
@@ -350,30 +331,27 @@ _pygi_marshal_to_py_gslist (PyGIInvokeState *state,
static void
_pygi_marshal_cleanup_to_py_glist (PyGIInvokeState *state,
PyGIArgCache *arg_cache,
- gpointer cleanup_data,
+ PyObject *dummy,
gpointer data,
gboolean was_processed)
{
- GPtrArray *item_cleanups = (GPtrArray *) cleanup_data;
PyGISequenceCache *sequence_cache = (PyGISequenceCache *)arg_cache;
if (arg_cache->transfer == GI_TRANSFER_EVERYTHING ||
arg_cache->transfer == GI_TRANSFER_CONTAINER) {
GSList *list_ = (GSList *)data;
if (sequence_cache->item_cache->to_py_cleanup != NULL) {
- PyGIMarshalToPyCleanupFunc cleanup_func =
+ PyGIMarshalCleanupFunc cleanup_func =
sequence_cache->item_cache->to_py_cleanup;
GSList *node = list_;
- guint i = 0;
while (node != NULL) {
cleanup_func (state,
sequence_cache->item_cache,
- g_ptr_array_index(item_cleanups, i),
+ NULL,
node->data,
was_processed);
node = node->next;
- i++;
}
}
@@ -385,8 +363,6 @@ _pygi_marshal_cleanup_to_py_glist (PyGIInvokeState *state,
g_assert_not_reached();
}
}
-
- g_ptr_array_unref (item_cleanups);
}
static void
diff --git a/gi/pygi-marshal-cleanup.c b/gi/pygi-marshal-cleanup.c
index ddda5943..906be58c 100644
--- a/gi/pygi-marshal-cleanup.c
+++ b/gi/pygi-marshal-cleanup.c
@@ -119,15 +119,13 @@ pygi_marshal_cleanup_args_to_py_marshal_success (PyGIInvokeState *state,
PyGICallableCache *cache)
{
GSList *cache_item;
- guint i = 0;
-
/* clean up the return if available */
if (cache->return_cache != NULL) {
- PyGIMarshalToPyCleanupFunc cleanup_func = cache->return_cache->to_py_cleanup;
+ PyGIMarshalCleanupFunc cleanup_func = cache->return_cache->to_py_cleanup;
if (cleanup_func && state->return_arg.v_pointer != NULL)
cleanup_func (state,
cache->return_cache,
- state->to_py_return_arg_cleanup_data,
+ NULL,
state->return_arg.v_pointer,
TRUE);
}
@@ -136,24 +134,23 @@ pygi_marshal_cleanup_args_to_py_marshal_success (PyGIInvokeState *state,
cache_item = cache->to_py_args;
while (cache_item) {
PyGIArgCache *arg_cache = (PyGIArgCache *) cache_item->data;
- PyGIMarshalToPyCleanupFunc cleanup_func = arg_cache->to_py_cleanup;
+ PyGIMarshalCleanupFunc cleanup_func = arg_cache->to_py_cleanup;
gpointer data = state->args[arg_cache->c_arg_index].arg_value.v_pointer;
if (cleanup_func != NULL && data != NULL)
cleanup_func (state,
arg_cache,
- state->args[arg_cache->c_arg_index].to_py_arg_cleanup_data,
+ NULL,
data,
TRUE);
else if (arg_cache->is_caller_allocates && data != NULL) {
_cleanup_caller_allocates (state,
arg_cache,
- state->args[arg_cache->c_arg_index].to_py_arg_cleanup_data,
+ NULL,
data,
TRUE);
}
- i++;
cache_item = cache_item->next;
}
}
diff --git a/gi/pygi-object.c b/gi/pygi-object.c
index 80c90555..8fd8ee0f 100644
--- a/gi/pygi-object.c
+++ b/gi/pygi-object.c
@@ -279,8 +279,7 @@ static PyObject *
_pygi_marshal_to_py_called_from_c_interface_object_cache_adapter (PyGIInvokeState *state,
PyGICallableCache *callable_cache,
PyGIArgCache *arg_cache,
- GIArgument *arg,
- gpointer *cleanup_data)
+ GIArgument *arg)
{
return pygi_arg_gobject_to_py_called_from_c (arg, arg_cache->transfer);
}
@@ -289,8 +288,7 @@ static PyObject *
_pygi_marshal_to_py_called_from_py_interface_object_cache_adapter (PyGIInvokeState *state,
PyGICallableCache *callable_cache,
PyGIArgCache *arg_cache,
- GIArgument *arg,
- gpointer *cleanup_data)
+ GIArgument *arg)
{
return pygi_arg_gobject_to_py (arg, arg_cache->transfer);
}
@@ -298,7 +296,7 @@ _pygi_marshal_to_py_called_from_py_interface_object_cache_adapter (PyGIInvokeSta
static void
_pygi_marshal_cleanup_to_py_interface_object (PyGIInvokeState *state,
PyGIArgCache *arg_cache,
- gpointer cleanup_data,
+ PyObject *dummy,
gpointer data,
gboolean was_processed)
{
diff --git a/gi/pygi-struct-marshal.c b/gi/pygi-struct-marshal.c
index f1b9f13b..d594239f 100644
--- a/gi/pygi-struct-marshal.c
+++ b/gi/pygi-struct-marshal.c
@@ -435,8 +435,7 @@ static PyObject *
arg_struct_to_py_marshal_adapter (PyGIInvokeState *state,
PyGICallableCache *callable_cache,
PyGIArgCache *arg_cache,
- GIArgument *arg,
- gpointer *cleanup_data)
+ GIArgument *arg)
{
PyGIInterfaceCache *iface_cache = (PyGIInterfaceCache *)arg_cache;
@@ -452,7 +451,7 @@ arg_struct_to_py_marshal_adapter (PyGIInvokeState *state,
static void
arg_foreign_to_py_cleanup (PyGIInvokeState *state,
PyGIArgCache *arg_cache,
- gpointer cleanup_data,
+ PyObject *dummy,
gpointer data,
gboolean was_processed)
{