From 78aaa0a3dd9ec06b650636d2b4dd4ff009a36cf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Mon, 31 Jan 2022 16:12:54 +0100 Subject: [PATCH] pulse-server: client: move to cleanup list on detach Move a client to the `impl->cleanup_clients` list right after it has been removed its server's `clients` list. --- src/modules/module-protocol-pulse/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/module-protocol-pulse/client.c b/src/modules/module-protocol-pulse/client.c index 080d69162..dff7af9a0 100644 --- a/src/modules/module-protocol-pulse/client.c +++ b/src/modules/module-protocol-pulse/client.c @@ -99,6 +99,7 @@ bool client_detach(struct client *client) /* remove from the `server->clients` list */ spa_list_remove(&client->link); + spa_list_append(&impl->cleanup_clients, &client->link); server->n_clients--; if (server->wait_clients > 0 && --server->wait_clients == 0) { @@ -125,7 +126,6 @@ void client_disconnect(struct client *client) spa_assert(client->server == NULL); client->disconnect = true; - spa_list_append(&impl->cleanup_clients, &client->link); pw_map_for_each(&client->streams, client_free_stream, client);