From 97e6a11996855800f68dc41c13537784198c8b61 Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Fri, 20 Apr 2012 12:28:31 +0200 Subject: dbus-job: allow multiple bus clients Merging of jobs can result in more than one client being interested in a job. --- src/core/dbus.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/core/dbus.c') diff --git a/src/core/dbus.c b/src/core/dbus.c index fe73b0a434..434796456b 100644 --- a/src/core/dbus.c +++ b/src/core/dbus.c @@ -1167,13 +1167,15 @@ static void shutdown_connection(Manager *m, DBusConnection *c) { Job *j; Iterator i; - HASHMAP_FOREACH(j, m->jobs, i) - if (j->bus == c) { - free(j->bus_client); - j->bus_client = NULL; - - j->bus = NULL; + HASHMAP_FOREACH(j, m->jobs, i) { + JobBusClient *cl, *nextcl; + LIST_FOREACH_SAFE(client, cl, nextcl, j->bus_client_list) { + if (cl->bus == c) { + LIST_REMOVE(JobBusClient, client, j->bus_client_list, cl); + free(cl); + } } + } set_remove(m->bus_connections, c); set_remove(m->bus_connections_for_dispatch, c); -- cgit v1.2.3-54-g00ecf