diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-08-22 16:11:54 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-08-22 17:31:36 +0200 |
commit | 232f367766b35fa248476d0ded49781a06a80ae1 (patch) | |
tree | d0556cdcc1dce2b4e6636d55625397527c64e3ed /src/libsystemd/sd-bus/sd-bus.c | |
parent | 8b6e65ac32627e371ee61f7d086ed33bc47e4b4c (diff) |
sd-bus: when the server-side disconnects, make sure to dispatch all tracking objects immediately
If the server side kicks us from the bus, from our view no names are on the bus
anymore, hence let's make sure to dispatch all tracking objects immediately.
Diffstat (limited to 'src/libsystemd/sd-bus/sd-bus.c')
-rw-r--r-- | src/libsystemd/sd-bus/sd-bus.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c index 95c37d8b19..6ee5f82e12 100644 --- a/src/libsystemd/sd-bus/sd-bus.c +++ b/src/libsystemd/sd-bus/sd-bus.c @@ -107,6 +107,7 @@ static void bus_free(sd_bus *b) { assert(b); assert(!b->track_queue); + assert(!b->tracks); b->state = BUS_CLOSED; @@ -2706,6 +2707,12 @@ static int process_closing(sd_bus *bus, sd_bus_message **ret) { if (c) return process_closing_reply_callback(bus, c); + /* Then, fake-drop all remaining bus tracking references */ + if (bus->tracks) { + bus_track_close(bus->tracks); + return 1; + } + /* Then, synthesize a Disconnected message */ r = sd_bus_message_new_signal( bus, |