summaryrefslogtreecommitdiff
path: root/gi/pygi-struct-marshal.c
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2018-02-08 09:02:37 +0100
committerChristoph Reiter <reiter.christoph@gmail.com>2018-02-08 09:11:16 +0100
commitd371fd77d33c2987cc450bd68ce4ee4835e09bd8 (patch)
tree5b2c84c2d985b6cf6520c729d89b5dc152d55c4a /gi/pygi-struct-marshal.c
parent024ac583538976330b429b9b203d412fec0426e3 (diff)
downloadpygobject-d371fd77d33c2987cc450bd68ce4ee4835e09bd8.tar.gz
Revert "to-py-struct: don't copy the boxed if we are the sole owner of the wrapper"
This reverts commit a4a68b3c7a4bb64c71e1bdbe52ede109b6bcd0bb. This was wrong. In the context of a boxed return value we also have only one ref but it doesn't get freed after. We could decide this based on PYGI_CALLING_CONTEXT_IS_FROM_C from the callable cache, but let's leave that for now.
Diffstat (limited to 'gi/pygi-struct-marshal.c')
-rw-r--r--gi/pygi-struct-marshal.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/gi/pygi-struct-marshal.c b/gi/pygi-struct-marshal.c
index 48ed7445..44797e75 100644
--- a/gi/pygi-struct-marshal.c
+++ b/gi/pygi-struct-marshal.c
@@ -475,15 +475,8 @@ arg_boxed_to_py_cleanup (PyGIInvokeState *state,
gpointer data,
gboolean was_processed)
{
- PyGIBoxed *boxed;
-
- if (arg_cache->transfer == GI_TRANSFER_NOTHING) {
- boxed = (PyGIBoxed *) cleanup_data;
- /* If we are the sole owner of the wrapper it will be freed after this
- * anyway, so no need to copy the wrapped boxed. */
- if (Py_REFCNT (boxed) > 1)
- _pygi_boxed_copy_in_place (boxed);
- }
+ if (arg_cache->transfer == GI_TRANSFER_NOTHING)
+ _pygi_boxed_copy_in_place ((PyGIBoxed *) cleanup_data);
}
static gboolean