summaryrefslogtreecommitdiff
path: root/gdbus
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2012-12-16 01:06:33 +0100
committerMarcel Holtmann <marcel@holtmann.org>2012-12-19 03:49:11 +0100
commit5b0e16952d4ab058b55d00197f53e296042be31e (patch)
tree461c1656ed3b9bab77cad3606fe280bf993cf847 /gdbus
parent895b9f7facddd93154e77f88119924e70c6327d8 (diff)
downloadconnman-5b0e16952d4ab058b55d00197f53e296042be31e.tar.gz
connman-5b0e16952d4ab058b55d00197f53e296042be31e.tar.bz2
connman-5b0e16952d4ab058b55d00197f53e296042be31e.zip
gdbus: Fix issue with unref of client while parsing interfaces
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 670f6a74..76e4cc17 100644
--- a/gdbus/client.c
+++ b/gdbus/client.c
@@ -675,7 +675,11 @@ static void interfaces_added(GDBusClient *client, DBusMessage *msg)
dbus_message_iter_get_basic(&iter, &path);
dbus_message_iter_next(&iter);
+ g_dbus_client_ref(client);
+
parse_interfaces(client, path, &iter);
+
+ g_dbus_client_unref(client);
}
static void interfaces_removed(GDBusClient *client, DBusMessage *msg)
@@ -697,6 +701,8 @@ static void interfaces_removed(GDBusClient *client, DBusMessage *msg)
dbus_message_iter_recurse(&iter, &entry);
+ g_dbus_client_ref(client);
+
while (dbus_message_iter_get_arg_type(&entry) == DBUS_TYPE_STRING) {
const char *interface;
@@ -704,6 +710,8 @@ static void interfaces_removed(GDBusClient *client, DBusMessage *msg)
proxy_remove(client, path, interface);
dbus_message_iter_next(&entry);
}
+
+ g_dbus_client_unref(client);
}
static void parse_managed_objects(GDBusClient *client, DBusMessage *msg)