GNOME Bugzilla – Bug 780202
introspection: Don't expose GValueArray.free
Last modified: 2017-09-11 20:52:34 UTC
I know this is all deprecated, but I think we should keep it safe. Right now, we expose GObject.ValueArray.free in bindings, which can lead to crash. In Python: from gi.repository import GObject v = GObject.ValueArray() v.append(1234) v.free() v.get_nth(1) I think that this function should be skipped. Correct me if I'm wrong. In anycase the interpretor should never crash.
Created attachment 348184 [details] [review] valuearray: Skip g_value_array_free() in bindings Calling this function can easily lead to an interpreter crash.
Review of attachment 348184 [details] [review]: Yes, this should definitely be skipped, but the gobject-introspection data for GLib is generated inside gobject-introspection itself, so it'll need to be re-generated there.
See: https://git.gnome.org//browse/gobject-introspection/tree/gir/gobject-2.0.c#n5992
Oh, ok, didn't know, I guess we need both this patch and a GI updated.
Pushing this now; will regenerate the gobject-introspection data for GLib later. Attachment 348184 [details] pushed as 0d9c512 - valuearray: Skip g_value_array_free() in bindings
(In reply to Philip Withnall from comment #5) > Pushing this now; will regenerate the gobject-introspection data for GLib > later. In fact, it looks like the general approach the gobject-introspection maintainers are taking is to update the annotations once for each GLib release; so let’s go with that.