Skip to content

Fix use-after-free when a GValue is an out argument

Xavier Claessens requested to merge xclaesse/pygobject:out-value into main

I have a C function with a signature like:

gboolean my_object_get_property(MyObject *self, GValue *out_val);

In the case out_value is annotated with (out), pygi will allocate a new GValue before calling my function. If my function sets a boxed type inside that GValue it needs to be copied when marshalled into a python object because pygi_arg_gvalue_from_py_cleanup() will call g_value_unset() which will free the boxed value.

Merge request reports