Skip to content
Commit d7d28d71 authored by Martin Pitt's avatar Martin Pitt
Browse files

Fix Python to C marshalling of GValue arrays

For GValues we cannot just copy the GValue memory in
_pygi_marshal_from_py_array(), as the from_py_cleanup() function clears and
releases the GValue and with it its v_pointer. Use g_value_copy() to copy by
value instead.

This uncovered another bug in _pygi_marshal_cleanup_from_py_array(): It always
assumed that C arrays contained pointers, but this is not the case for GValue
arrays: these are actual struct arrays, not struct pointer arrays (cf. their
construction in _pygi_marshal_from_py_array()). Check if an array contains
pointers or values and compute the correct array item pointer for both cases.

Also add a corresponding test case for marshalling GValue arrays from C back to
Python, which works fine.

https://bugzilla.gnome.org/show_bug.cgi?id=672065
parent 27ac9c1d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment