From cad84d5e27562bfc5d9eaa33b036705b0e4e784f Mon Sep 17 00:00:00 2001 From: Tobias Stoeckmann Date: Mon, 11 Aug 2025 21:43:35 +0200 Subject: [PATCH] gobject: Annotate (un)ref functions transfer full Annotate ref and unref functions with transfer full for better documentation and correct gir file creation. --- gobject/gclosure.c | 4 ++-- gobject/gobject.c | 4 ++-- gobject/gtype.c | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gobject/gclosure.c b/gobject/gclosure.c index 3a80c17f3..415f34a69 100644 --- a/gobject/gclosure.c +++ b/gobject/gclosure.c @@ -611,7 +611,7 @@ closure_ref_internal (GClosure *closure) * Increments the reference count on a closure to force it staying * alive while the caller holds a pointer to it. * - * Returns: (transfer none): The @closure passed in, for convenience + * Returns: (transfer full): The @closure passed in, for convenience */ GClosure* g_closure_ref (GClosure *closure) @@ -671,7 +671,7 @@ g_closure_invalidate (GClosure *closure) /** * g_closure_unref: - * @closure: #GClosure to decrement the reference count on + * @closure: (transfer full): #GClosure to decrement the reference count on * * Decrements the reference count of a closure after it was previously * incremented by the same caller. diff --git a/gobject/gobject.c b/gobject/gobject.c index a32917b42..a447e5142 100644 --- a/gobject/gobject.c +++ b/gobject/gobject.c @@ -4644,7 +4644,7 @@ retry: * extension), so any casting the caller needs to do on the return type must be * explicit. * - * Returns: (type GObject.Object) (transfer none): the same @object + * Returns: (type GObject.Object) (transfer full): the same @object */ gpointer (g_object_ref) (gpointer _object) @@ -4720,7 +4720,7 @@ _object_unref_clear_weak_locations (GObject *object, gint *p_old_ref, gboolean d /** * g_object_unref: - * @object: (type GObject.Object): a #GObject + * @object: (type GObject.Object) (transfer full):: a #GObject * * Decreases the reference count of @object. When its reference count * drops to 0, the object is finalized (i.e. its memory is freed). diff --git a/gobject/gtype.c b/gobject/gtype.c index 4469aacfd..998a9962e 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 none): the #GTypeClass + * Returns: (type GObject.TypeClass) (transfer full): 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): a #GTypeClass structure to unref + * @g_class: (type GObject.TypeClass) (transfer full): 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 none): the default + * Returns: (type GObject.TypeInterface) (transfer full): 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): the default vtable + * @g_iface: (type GObject.TypeInterface) (transfer full): 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