gobject: Annotate (un)ref functions transfer full

Annotate ref and unref functions with transfer full for better
documentation and correct gir file creation.
This commit is contained in:
Tobias Stoeckmann
2025-08-11 21:43:35 +02:00
parent 3368a9cc7a
commit cad84d5e27
3 changed files with 8 additions and 8 deletions

View File

@@ -611,7 +611,7 @@ closure_ref_internal (GClosure *closure)
* Increments the reference count on a closure to force it staying * Increments the reference count on a closure to force it staying
* alive while the caller holds a pointer to it. * 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* GClosure*
g_closure_ref (GClosure *closure) g_closure_ref (GClosure *closure)
@@ -671,7 +671,7 @@ g_closure_invalidate (GClosure *closure)
/** /**
* g_closure_unref: * 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 * Decrements the reference count of a closure after it was previously
* incremented by the same caller. * incremented by the same caller.

View File

@@ -4644,7 +4644,7 @@ retry:
* extension), so any casting the caller needs to do on the return type must be * extension), so any casting the caller needs to do on the return type must be
* explicit. * explicit.
* *
* Returns: (type GObject.Object) (transfer none): the same @object * Returns: (type GObject.Object) (transfer full): the same @object
*/ */
gpointer gpointer
(g_object_ref) (gpointer _object) (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: * 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 * Decreases the reference count of @object. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed). * drops to 0, the object is finalized (i.e. its memory is freed).

View File

@@ -2775,7 +2775,7 @@ g_type_class_get (GType type)
* *
* This function will demand-create the class if it doesn't exist already. * 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 * structure for the given type ID
* *
* Deprecated: 2.84: Use g_type_class_get() instead * Deprecated: 2.84: Use g_type_class_get() instead
@@ -2788,7 +2788,7 @@ g_type_class_ref (GType type)
/** /**
* g_type_class_unref: * 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. * 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 * 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() * vtable for the interface; call g_type_default_interface_unref()
* when you are done using the interface. * 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_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() * structure for an interface, as returned by g_type_default_interface_ref()
* *
* Decrements the reference count for the type corresponding to the * Decrements the reference count for the type corresponding to the