mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-10-26 05:52:16 +01:00
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 cad84d5e27.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user