diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2012-03-14 22:52:47 +0100 |
---|---|---|
committer | Martin Pitt <martin.pitt@ubuntu.com> | 2012-03-16 12:05:50 +0100 |
commit | d7d28d717e38c0546529b09b8b571a5cc631c5b5 (patch) | |
tree | ab3a50545cc8faeb50549698095ad74eb51e0e62 /examples | |
parent | 27ac9c1de6487035b18ef4511c155d251cb6d39d (diff) | |
download | pygobject-d7d28d717e38c0546529b09b8b571a5cc631c5b5.tar.gz |
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
Diffstat (limited to 'examples')
0 files changed, 0 insertions, 0 deletions