Fix bad memory management in vfunc marshalling
The gobject-introspection test suite contains some tests that test memory management of values that are passed into or returned from vfuncs: https://gitlab.gnome.org/GNOME/gobject-introspection/blob/a62855702c3bc0b10370ef25d622a32e227283bd/tests/gimarshallingtests.c#L4713-4864
We have some memory problems with two of the six cases:
-
return value, transfer-none -
return value, transfer-full -
out parameter, transfer-none -
out parameter, transfer-full: the object is unrefed when it's not supposed to be, and crashes at the next GC with a double free -
in parameter, transfer-none -
in parameter, transfer-full: crashesleaks the argument
Verify the fix by un-disabling the tests in testGIMarshalling.js and checking that it passes correctly.
Edited by Philip Chimento