Commit 329afb6f authored by John (J5) Palmieri's avatar John (J5) Palmieri
Browse files

[gi] fix handling of garrays vs c arrays

parent f6605138
......@@ -2635,8 +2635,13 @@ array_success:
state->in_args[aux_cache->c_arg_index].v_long = length;
}
(*arg).v_pointer = array_->data;
g_array_free(array_, FALSE);
if (sequence_cache->array_type == GI_ARRAY_TYPE_C) {
arg->v_pointer = array_->data;
g_array_free(array_, FALSE);
} else {
arg->v_pointer = array_;
}
return TRUE;
}
......
......@@ -403,6 +403,8 @@ _arg_cache_new_for_in_array(PyGIFunctionCache *function_cache,
PyGISequenceCache *seq_cache = _sequence_cache_new_from_type_info(type_info, (function_cache->is_method ? 1: 0));
PyGIArgCache *arg_cache = (PyGIArgCache *)seq_cache;
seq_cache->array_type = g_type_info_get_array_type(type_info);
if (seq_cache->len_arg_index >= 0) {
PyGIArgCache *aux_cache = _arg_cache_new();
aux_cache->aux_type = PYGI_AUX_TYPE_IGNORE;
......
......@@ -82,6 +82,7 @@ typedef struct _PyGISequenceCache
gint len_arg_index;
gboolean is_zero_terminated;
gsize item_size;
GIArrayType array_type;
PyGIArgCache *item_cache;
} PyGISequenceCache;
......
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