Commit 99d6e6c8 authored by John (J5) Palmieri's avatar John (J5) Palmieri

[gi] fix container object reffing

parent 4a67f458
......@@ -3240,9 +3240,9 @@ _pygi_marshal_in_interface_object (PyGIInvokeState *state,
return FALSE;
}
arg->v_pointer = pygobject_get (py_arg);
arg->v_pointer = pygobject_get(py_arg);
if (arg_cache->transfer == GI_TRANSFER_EVERYTHING)
g_object_ref (arg->v_pointer);
g_object_ref(arg->v_pointer);
return TRUE;
}
......@@ -3895,10 +3895,9 @@ _pygi_marshal_out_interface_object (PyGIInvokeState *state,
{
PyObject *py_obj = pygobject_new (arg->v_pointer);
/* The new wrapper increased the reference count, so decrease it. */
if (arg_cache->transfer == GI_TRANSFER_EVERYTHING)
g_object_unref (arg->v_pointer);
return py_obj;
}
......
......@@ -181,10 +181,8 @@ _sequence_cache_new_from_type_info(GITypeInfo *type_info,
item_type_info = g_type_info_get_param_type (type_info, 0);
item_type_tag = g_type_info_get_tag (item_type_info);
item_transfer = GI_TRANSFER_NOTHING;
if (transfer == GI_TRANSFER_EVERYTHING ||
transfer == GI_TRANSFER_CONTAINER)
item_transfer = GI_TRANSFER_EVERYTHING;
item_transfer =
transfer == GI_TRANSFER_CONTAINER ? GI_TRANSFER_NOTHING : transfer;
sc->item_cache = _arg_cache_new_from_type_info(item_type_info,
NULL,
......@@ -225,10 +223,8 @@ _hash_cache_new_from_type_info(GITypeInfo *type_info,
value_type_info = g_type_info_get_param_type (type_info, 1);
value_type_tag = g_type_info_get_tag (value_type_info);
item_transfer = GI_TRANSFER_NOTHING;
if (transfer == GI_TRANSFER_EVERYTHING ||
transfer == GI_TRANSFER_CONTAINER)
item_transfer = GI_TRANSFER_EVERYTHING;
item_transfer =
transfer == GI_TRANSFER_CONTAINER ? GI_TRANSFER_NOTHING : transfer;
hc->key_cache = _arg_cache_new_from_type_info(key_type_info,
NULL,
......
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