diff options
Diffstat (limited to 'src/core/dbus.c')
-rw-r--r-- | src/core/dbus.c | 14 |
1 files changed, 8 insertions, 6 deletions
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); |