hugopl/gi-crystal

Virtual functions does not obey return value ownership transfer

hugopl opened this issue · 1 comments

hugopl commented

Found this while trying to create a Gio::ListModel, the get_item virtual func returns an GObject, but with transfer full, this makes the C code steal the reference owned by the Crystal object, then at some time a nice crash will happen.

To fix that the vfunc machinery needs to increase the reference of the returned object before returning it to C world.

hugopl commented

The MR above wasn't about to fix this, just mentioning.