summaryrefslogtreecommitdiff
path: root/gdbus
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2012-12-15 23:34:51 +0100
committerMarcel Holtmann <marcel@holtmann.org>2012-12-19 03:49:11 +0100
commit895b9f7facddd93154e77f88119924e70c6327d8 (patch)
treeda09d19c60ca80bb839dcac991f87a5fc7715084 /gdbus
parent2fa46089e724a84f5e2d92ef3716e6935e83fd49 (diff)
downloadconnman-895b9f7facddd93154e77f88119924e70c6327d8.tar.gz
connman-895b9f7facddd93154e77f88119924e70c6327d8.tar.bz2
connman-895b9f7facddd93154e77f88119924e70c6327d8.zip
gdbus: Fix issue with unref of client in connect handler
Diffstat (limited to 'gdbus')
-rw-r--r--gdbus/client.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdbus/client.c b/gdbus/client.c
index 750242c4..670f6a74 100644
--- a/gdbus/client.c
+++ b/gdbus/client.c
@@ -757,6 +757,8 @@ done:
dbus_pending_call_unref(client->pending_call);
client->pending_call = NULL;
+
+ g_dbus_client_unref(client);
}
static void get_managed_objects(GDBusClient *client)
@@ -777,6 +779,8 @@ static void get_managed_objects(GDBusClient *client)
return;
}
+ g_dbus_client_ref(client);
+
dbus_pending_call_set_notify(client->pending_call,
get_managed_objects_reply, client, NULL);
@@ -804,6 +808,8 @@ static void get_name_owner_reply(DBusPendingCall *call, void *user_data)
g_free(client->unique_name);
client->unique_name = g_strdup(name);
+ g_dbus_client_ref(client);
+
if (client->connect_func)
client->connect_func(client->dbus_conn, client->connect_data);
@@ -814,6 +820,8 @@ done:
client->pending_call = NULL;
get_managed_objects(client);
+
+ g_dbus_client_unref(client);
}
static void get_name_owner(GDBusClient *client, const char *name)