[glib] g_object_get_property: document that value must be initialized



commit ac4722df1c9802b0c78bba31aa9004348eb1813d
Author: Will Thompson <will thompson collabora co uk>
Date:   Fri Dec 17 12:34:28 2010 +0000

    g_object_get_property: document that value must be initialized
    
    I couldn't tell from reading the documentation whether I had to pass in
    an uninitialized value, or a value initialized to the exact type, or
    something else. It turns out (from reading the source) that you have to
    pass in an initialized value, but you can use any type to which the
    property's actual type can be transformed.
    
    So, let's document this.

 gobject/gobject.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gobject/gobject.c b/gobject/gobject.c
index 8b427fa..f1fa54d 100644
--- a/gobject/gobject.c
+++ b/gobject/gobject.c
@@ -1906,7 +1906,9 @@ g_object_set_property (GObject	    *object,
  * @property_name: the name of the property to get
  * @value: return location for the property value
  *
- * Gets a property of an object.
+ * Gets a property of an object. @value must have been initialized to the
+ * expected type of the property (or a type to which the expected type can be
+ * transformed) using g_value_init().
  *
  * In general, a copy is made of the property contents and the caller is
  * responsible for freeing the memory by calling g_value_unset().



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