Commit dc3d2117 authored by Mike Gorse's avatar Mike Gorse Committed by Martin Pitt
Browse files

Mark caller-allocated boxed structures as having a slice allocated

When a C function takes a pointer and fills it with a boxed structure (ie,
gtk_tree_store_insert_with_values), pygi should deallocate the slice when the
box is no longer being used.

https://bugzilla.gnome.org/show_bug.cgi?id=699501
parent 0c496d23
......@@ -815,7 +815,9 @@ _pygi_marshal_to_py_interface_struct (PyGIInvokeState *state,
arg->v_pointer);
} else if (g_type_is_a (type, G_TYPE_BOXED)) {
py_obj = _pygi_boxed_new ( (PyTypeObject *)iface_cache->py_type, arg->v_pointer,
arg_cache->transfer == GI_TRANSFER_EVERYTHING);
arg_cache->transfer == GI_TRANSFER_EVERYTHING || arg_cache->is_caller_allocates);
if (arg_cache->is_caller_allocates)
((PyGIBoxed *)py_obj)->slice_allocated = TRUE;
} else if (g_type_is_a (type, G_TYPE_POINTER)) {
if (iface_cache->py_type == NULL ||
!PyType_IsSubtype ( (PyTypeObject *)iface_cache->py_type, &PyGIStruct_Type)) {
......
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