diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-07-07 22:28:02 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-07-07 22:28:02 +0200 |
commit | 923f8d76dc1e14be0d8c969b1661d0279ddd97ba (patch) | |
tree | d49a95fca6723ae20a1096f8c7196bdbd3284b35 | |
parent | b3eaa6288107210a84d6d121036fb4b2f7283ee2 (diff) |
dbus: shut down bus connection cleanly and fully when a direct client disconnects
-rw-r--r-- | src/dbus.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/dbus.c b/src/dbus.c index 817219764d..0008cfd303 100644 --- a/src/dbus.c +++ b/src/dbus.c @@ -71,6 +71,7 @@ static const char *error_to_dbus(int error); static void bus_done_api(Manager *m); static void bus_done_system(Manager *m); static void bus_done_private(Manager *m); +static void shutdown_connection(Manager *m, DBusConnection *c); static void bus_dispatch_status(DBusConnection *bus, DBusDispatchStatus status, void *data) { Manager *m = data; @@ -477,11 +478,8 @@ static DBusHandlerResult private_bus_message_filter(DBusConnection *connection, dbus_message_get_member(message), dbus_message_get_path(message)); - if (dbus_message_is_signal(message, DBUS_INTERFACE_LOCAL, "Disconnected")) { - set_remove(m->bus_connections, connection); - set_remove(m->bus_connections_for_dispatch, connection); - dbus_connection_unref(connection); - } + if (dbus_message_is_signal(message, DBUS_INTERFACE_LOCAL, "Disconnected")) + shutdown_connection(m, connection); return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } |