[couchdb-glib] Replace g_value_get_object and g_object_ref with g_value_dup_object



commit d54c66da827c2b1bc6fff48be1088d6e1ebd4d60
Author: Krzysztof Klimonda <kklimonda ubuntu com>
Date:   Mon Aug 23 16:52:39 2010 +0200

    Replace g_value_get_object and g_object_ref with g_value_dup_object

 couchdb-glib/couchdb-document.c |    2 +-
 couchdb-glib/utils.c            |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/couchdb-glib/couchdb-document.c b/couchdb-glib/couchdb-document.c
index 78336a5..cdee82e 100644
--- a/couchdb-glib/couchdb-document.c
+++ b/couchdb-glib/couchdb-document.c
@@ -69,7 +69,7 @@ couchdb_document_set_property (GObject *object,
 	case PROP_DATABASE:
 		if (document->priv->database != NULL)
 			g_object_unref (G_OBJECT (document->priv->database));
-		document->priv->database = g_object_ref (G_OBJECT (g_value_get_object (value)));
+		document->priv->database = g_value_dup_object (value);
 		break;
 	default:
                 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
diff --git a/couchdb-glib/utils.c b/couchdb-glib/utils.c
index d11a8ed..d5fcd0a 100644
--- a/couchdb-glib/utils.c
+++ b/couchdb-glib/utils.c
@@ -56,7 +56,7 @@ get_type_from_field (JsonObject *json_object, const gchar *field)
 
 	node = json_object_get_member (json_object, field);
 	if (node == NULL)
-		G_TYPE_INVALID;
+		return G_TYPE_INVALID;
 
 	type = json_node_get_value_type (node);
 	switch (type) {



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