summaryrefslogtreecommitdiff
path: root/gi/pygi-array.c
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2018-04-13 19:50:00 +0200
committerChristoph Reiter <reiter.christoph@gmail.com>2018-04-13 19:50:00 +0200
commit80b8d459303bf763873681d3a27fda4a1288d4b5 (patch)
tree920ce33c389d026b5df276796a546fb84c6925f9 /gi/pygi-array.c
parentc745866df9e4394c6615e79779fff1221a84953a (diff)
downloadpygobject-80b8d459303bf763873681d3a27fda4a1288d4b5.tar.gz
pygi-array: fix a leak
We allocate the cleanup data even if there is no cleanup callback registered in the item cache.
Diffstat (limited to 'gi/pygi-array.c')
-rw-r--r--gi/pygi-array.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gi/pygi-array.c b/gi/pygi-array.c
index 3c30626a..a0634dcc 100644
--- a/gi/pygi-array.c
+++ b/gi/pygi-array.c
@@ -789,9 +789,11 @@ _pygi_marshal_cleanup_to_py_array (PyGIInvokeState *state,
(array_ != NULL) ? g_array_index (array_, gpointer, i) : g_ptr_array_index (ptr_array_, i),
was_processed);
}
- g_ptr_array_unref (item_cleanups);
}
+ if (cleanup_data)
+ g_ptr_array_unref ((GPtrArray *) cleanup_data);
+
if (free_array) {
if (array_ != NULL)
g_array_free (array_, free_array_full);