summaryrefslogtreecommitdiff
path: root/gdbus
diff options
context:
space:
mode:
authorLuiz Augusto Von Dentz <luiz.dentz-von@nokia.com>2010-09-06 13:26:19 +0300
committerMarcel Holtmann <marcel@holtmann.org>2010-09-08 18:29:08 +0200
commit24e666c801f5188d791f5b3725a1c91b45c48a7a (patch)
treea776feffccaca777d61eaf6fa627b6d8e81e8cb5 /gdbus
parent3f5b873d23cf44fd46d2f132ebf1f6bb4ae71b1e (diff)
downloadconnman-24e666c801f5188d791f5b3725a1c91b45c48a7a.tar.gz
connman-24e666c801f5188d791f5b3725a1c91b45c48a7a.tar.bz2
connman-24e666c801f5188d791f5b3725a1c91b45c48a7a.zip
Do not automatically remove watches for service names
Services can be owned again so it is perfectly fine to keep the watch.
Diffstat (limited to 'gdbus')
-rw-r--r--gdbus/watch.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gdbus/watch.c b/gdbus/watch.c
index 29f23e2d..b686c858 100644
--- a/gdbus/watch.c
+++ b/gdbus/watch.c
@@ -386,18 +386,19 @@ static DBusHandlerResult service_filter(DBusConnection *connection,
cb->conn_func(connection, cb->user_data);
}
+ /* Only auto remove if it is a bus name watch */
+ if (data->argument[0] == ':' &&
+ (!cb->conn_func || !cb->disc_func)) {
+ filter_data_remove_callback(data, cb);
+ continue;
+ }
+
/* Check if the watch was removed/freed by the callback
* function */
if (!g_slist_find(data->callbacks, cb))
continue;
data->callbacks = g_slist_remove(data->callbacks, cb);
-
- if (!cb->conn_func || !cb->disc_func) {
- g_free(cb);
- continue;
- }
-
data->processed = g_slist_append(data->processed, cb);
}