GObject constructor arguments leak with GValue wrapping
Submitted by Simon Feltman
Link to original bug (#709879)
Description
Running valgrind on test_gi reveals the following leaks:
Test: tests/test_gi.py:TestPropertiesObject.test_variant: Code: GIMarshallingTests.PropertiesObject(some_variant=GLib.Variant('b', True)) Stack: 81 bytes, 1 blocks malloc g_malloc g_slice_alloc g_variant_alloc g_variant_new_from_bytes g_variant_new_from_trusted g_variant_new_boolean ffi_call_unix64 ffi_call g_callable_info_invoke g_function_info_invoke _invoke_callable
Test: tests/test_gi.py:TestPropertiesObject.test_boxed_struct: Code: GIMarshallingTests.PropertiesObject(some_boxed_struct=struct1) Stack: 24 bytes, 1 blocks malloc g_malloc g_slice_alloc gi_marshalling_tests_boxed_struct_copy gi_marshalling_tests_properties_object_set_property object_set_property g_object_new_internal g_object_newv pygobject_constructv pygobject_init type_call PyObject_Call
This could mean:
- We need to clear GParameter.value out using g_value_unset after g_object_newv in gi/_gobject.
- GIMarshallingTests needs to do it.
I tried a bit more verification with Gtk.Scrollbar(adjustment=Gtk.Adjustment()) but it seemed to be tracking references correctly. This points a bit more towards GIMarshalingTests needing work in property setting code.