summaryrefslogtreecommitdiff
path: root/giscanner/maintransformer.py
diff options
context:
space:
mode:
Diffstat (limited to 'giscanner/maintransformer.py')
-rw-r--r--giscanner/maintransformer.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index 517ddb2d..4ae55169 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -510,7 +510,10 @@ usage is void (*_gtk_reserved1)(void);"""
annotated_direction = ast.PARAM_DIRECTION_OUT
if subtype in (None, ''):
if node.type.target_giname and node.type.ctype:
- caller_allocates = '**' not in node.type.ctype
+ target = self._transformer.lookup_giname(node.type.target_giname)
+ has_double_indirection = '**' in node.type.ctype
+ is_structure_or_union = isinstance(target, (ast.Record, ast.Union))
+ caller_allocates = (not has_double_indirection and is_structure_or_union)
else:
caller_allocates = False
elif subtype == OPT_OUT_CALLER_ALLOCATES: