[glib] docs: Mention g_clear_object() in the GObject tutorial



commit cd0d605b23f9efe247475ba425f811a513a138db
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Thu Feb 19 14:08:43 2015 +0000

    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

 docs/reference/gobject/tut_gobject.xml |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/docs/reference/gobject/tut_gobject.xml b/docs/reference/gobject/tut_gobject.xml
index 71e989c..5af8ebd 100644
--- a/docs/reference/gobject/tut_gobject.xml
+++ b/docs/reference/gobject/tut_gobject.xml
@@ -248,8 +248,14 @@ MamanBar *bar = g_object_new (MAMAN_TYPE_BAR, NULL);
 
       <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 
-        increase and decrease the reference count.These functions are thread-safe as of GLib 2.8.
-        The reference count is, unsurprisingly, initialized to one by 
+        increase and decrease the reference count. These functions are
+        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
         is currently the sole owner of the newly-created reference.
         When the reference count reaches zero, that is, 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]