From 2ce48fcb0c746f5c0f80414ca8b3178fc9ade93d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Fri, 17 Oct 2025 04:07:22 +0200 Subject: [PATCH] gtype: Use transfer none for types (un)ref functions We have some (deprecated) methods that technically still return transfer-full instances of GTypeClass's and GTypeInterface's. The introspection scanner cannot generate bindings for them though since it does not know how to manage their lifecycle, and we end up skipping these symbols. This is breaking some language bindings, and in particular gjs [1] and lua-lgi, that were using the .ref methods. While we should not use deprecated functions in the language bindings, these symbols should still be introspected. [1] https://gitlab.gnome.org/GNOME/gjs/-/issues/711 Partially reverts commit cad84d5e27562bfc5d9eaa33b036705b0e4e784f. --- gobject/gtype.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gobject/gtype.c b/gobject/gtype.c index 998a9962e..4469aacfd 100644 --- a/gobject/gtype.c +++ b/gobject/gtype.c @@ -2775,7 +2775,7 @@ g_type_class_get (GType type) * * This function will demand-create the class if it doesn't exist already. * - * Returns: (type GObject.TypeClass) (transfer full): the #GTypeClass + * Returns: (type GObject.TypeClass) (transfer none): the #GTypeClass * structure for the given type ID * * Deprecated: 2.84: Use g_type_class_get() instead @@ -2788,7 +2788,7 @@ g_type_class_ref (GType type) /** * g_type_class_unref: - * @g_class: (type GObject.TypeClass) (transfer full): a #GTypeClass structure to unref + * @g_class: (type GObject.TypeClass): a #GTypeClass structure to unref * * Decrements the reference count of the class structure being passed in. * @@ -3028,7 +3028,7 @@ g_type_interface_peek_parent (gpointer g_iface) * * Deprecated: 2.84: Use g_type_default_interface_get() instead * - * Returns: (type GObject.TypeInterface) (transfer full): the default + * Returns: (type GObject.TypeInterface) (transfer none): the default * vtable for the interface; call g_type_default_interface_unref() * when you are done using the interface. */ @@ -3125,7 +3125,7 @@ g_type_default_interface_peek (GType g_type) /** * g_type_default_interface_unref: - * @g_iface: (type GObject.TypeInterface) (transfer full): the default vtable + * @g_iface: (type GObject.TypeInterface): the default vtable * structure for an interface, as returned by g_type_default_interface_ref() * * Decrements the reference count for the type corresponding to the