libnm: add warning for bindings about broken functions for transferred GPtrArray
In commit 201c153e ('libnm: fix GObject Introspection annotations for functions returning a GPtrArray') these annotations were changed to fix Vala bindings. However, bindings may treat the transfer annotation for GPtrArray differently, so depending on the binding we either get a leak or a double free. It's unclear how to fix that. For now, just add a warning to the documentation to avoid it. The following reproducer leads to a crash: #!/bin/python import gi gi.require_version("NM", "1.0") from gi.repository import NM def _pr(msg): NM.utils_print(0, msg + "\n") def process(nmc): for device in nmc.get_devices(): cons = device.filter_connections(nmc.get_connections()) _pr( "device %s (%s) has %s compatible connections" % (device.get_iface(), NM.Object.get_path(device), len(cons)) ) process(NM.Client.new()) See-also: https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/305
Please register or sign in to comment