Commit 50cfccb5 authored by John (J5) Palmieri's avatar John (J5) Palmieri
Browse files

[gi-invoke-ng] use g_slice for allocating GValues that are caller allocated

parent eff65cd2
......@@ -265,6 +265,8 @@ _invoke_marshal_in_args (PyGIInvokeState *state, PyGICallableCache *cache)
if (iface_cache->g_type == G_TYPE_BOXED) {
state->args[i]->v_pointer =
_pygi_boxed_alloc (iface_cache->interface_info, NULL);
} else if (iface_cache->g_type == G_TYPE_VALUE) {
state->args[i]->v_pointer = g_slice_new0 (GValue);
} else if (iface_cache->is_foreign) {
PyObject *foreign_struct =
pygi_struct_foreign_convert_from_g_argument (
......
......@@ -32,6 +32,8 @@ _cleanup_caller_allocates (PyGIInvokeState *state,
gsize size;
size = g_struct_info_get_size (iface_cache->interface_info);
g_slice_free1 (size, data);
} else if (iface_cache->g_type == G_TYPE_VALUE) {
g_slice_free (GValue, data);
} else if (iface_cache->is_foreign) {
pygi_struct_foreign_release ((GIBaseInfo *)iface_cache->interface_info,
data);
......
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