Commit 631d8ef8 authored by Mike Gorse's avatar Mike Gorse Committed by John (J5) Palmieri
Browse files

Reinstate copying of in-line structs in arrays

For arrays of in-line, non-boxed structures with (transfer full),
_pygi_marshal_free_out_array eventually gets called and frees the array
data, so we should copy it (IE, BGO#653588).

https://bugzilla.gnome.org/show_bug.cgi?id=657120
parent f38511f2
......@@ -335,7 +335,13 @@ _pygi_marshal_out_array (PyGIInvokeState *state,
switch (g_base_info_get_type (iface_cache->interface_info)) {
case GI_INFO_TYPE_STRUCT:
item_arg.v_pointer = array_->data + i * item_size;
if (arg_cache->transfer == GI_TRANSFER_EVERYTHING) {
gpointer *_struct = g_malloc (item_size);
memcpy (_struct, array_->data + i * item_size,
item_size);
item_arg.v_pointer = _struct;
} else
item_arg.v_pointer = array_->data + i * item_size;
break;
default:
item_arg.v_pointer = g_array_index (array_, gpointer, i);
......
Markdown is supported
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