mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-23 07:39:17 +02:00
docs: Mention g_clear_object() in the GObject tutorial
As an alternative to g_object_unref(). https://bugzilla.gnome.org/show_bug.cgi?id=744060
This commit is contained in:
parent
f9410b1647
commit
cd0d605b23
@ -248,8 +248,14 @@ MamanBar *bar = g_object_new (MAMAN_TYPE_BAR, NULL);
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
The functions <function><link linkend="g-object-ref">g_object_ref</link></function>/<function><link linkend="g-object-unref">g_object_unref</link></function> respectively
|
The functions <function><link linkend="g-object-ref">g_object_ref</link></function>/<function><link linkend="g-object-unref">g_object_unref</link></function> respectively
|
||||||
increase and decrease the reference count.These functions are thread-safe as of GLib 2.8.
|
increase and decrease the reference count. These functions are
|
||||||
The reference count is, unsurprisingly, initialized to one by
|
thread-safe.
|
||||||
|
<function><link linkend="g-clear-object">g_clear_object</link></function>
|
||||||
|
is a convenience wrapper around <function>g_object_unref</function>
|
||||||
|
which also clears the pointer passed to it.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
The reference count is initialized to one by
|
||||||
<function><link linkend="g-object-new">g_object_new</link></function> which means that the caller
|
<function><link linkend="g-object-new">g_object_new</link></function> which means that the caller
|
||||||
is currently the sole owner of the newly-created reference.
|
is currently the sole owner of the newly-created reference.
|
||||||
When the reference count reaches zero, that is,
|
When the reference count reaches zero, that is,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user