[libgda/LIBGDA_4.2] Allow NULL argument to gda_value_free()



commit ec8c448e7bf10020a9929db8e9d677ab89353c4c
Author: Vivien Malerba <malerba gnome-db org>
Date:   Mon Jul 25 21:58:53 2011 +0200

    Allow NULL argument to gda_value_free()

 libgda/gda-value.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/libgda/gda-value.c b/libgda/gda-value.c
index e9436e0..b776657 100644
--- a/libgda/gda-value.c
+++ b/libgda/gda-value.c
@@ -1368,14 +1368,15 @@ gda_value_new_from_xml (const xmlNodePtr node)
 
 /**
  * gda_value_free:
- * @value: (transfer full): the resource to free.
+ * @value: (transfer full) (allow-none): the resource to free (or %NULL)
  *
  * Deallocates all memory associated to a #GValue.
  */
 void
 gda_value_free (GValue *value)
 {
-	g_return_if_fail (value);
+	if (!value)
+		return;
 
 	l_g_value_unset (value);
 	g_free (value);



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