[couchdb-glib] Avoid warning when unref'ing a NULL object
- From: Rodrigo Moya <rodrigo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [couchdb-glib] Avoid warning when unref'ing a NULL object
- Date: Mon, 31 May 2010 16:48:58 +0000 (UTC)
commit cba0474f27bb4d78f07a1f21dc75f08745a34c1b
Author: Sam Thursfield <ssssam gmail com>
Date: Mon May 31 18:51:35 2010 +0200
Avoid warning when unref'ing a NULL object
couchdb-glib/couchdb-database.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/couchdb-glib/couchdb-database.c b/couchdb-glib/couchdb-database.c
index 8929508..e228a7e 100644
--- a/couchdb-glib/couchdb-database.c
+++ b/couchdb-glib/couchdb-database.c
@@ -87,7 +87,8 @@ couchdb_database_set_property (GObject *object,
switch (prop_id) {
case PROP_SESSION:
- g_object_unref (G_OBJECT (database->priv->session));
+ if (database->priv->session != NULL)
+ g_object_unref (G_OBJECT (database->priv->session));
database->priv->session = g_object_ref (G_OBJECT (g_value_get_object (value)));
break;
case PROP_DATABASE_NAME:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]