From ac4722df1c9802b0c78bba31aa9004348eb1813d Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Fri, 17 Dec 2010 12:34:28 +0000 Subject: [PATCH] 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 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gobject/gobject.c b/gobject/gobject.c index 8b427fa62..f1fa54d21 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().