+static DBusHandlerResult disconnection_filter_cb(DBusConnection *connection, DBusMessage *message, void *user_data) {
+ struct connection *c = user_data;
+
+ pa_assert(connection);
+ pa_assert(message);
+ pa_assert(c);
+
+ if (dbus_message_is_signal(message, "org.freedesktop.DBus.Local", "Disconnected")) {
+ /* The connection died. Now we want to free the connection object, but
+ * let's wait until this message is fully processed, in case someone
+ * else is interested in this signal too. */
+ c->server->userdata->module->core->mainloop->defer_enable(c->server->userdata->cleanup_event, 1);
+ }
+
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+}
+