From 24d795e9a4b800ade8f9da570d607f0eed188daf Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 17 Mar 2021 16:28:21 +0100 Subject: [PATCH] pulse-server: don't free stream map in disconnect The cleanup handler might still run and try to iterate the streams so make sure the map is not freed yet. See #901 --- src/modules/module-protocol-pulse/pulse-server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c index 9539f1155..2ac638115 100644 --- a/src/modules/module-protocol-pulse/pulse-server.c +++ b/src/modules/module-protocol-pulse/pulse-server.c @@ -5357,7 +5357,6 @@ static void client_disconnect(struct client *client) spa_list_append(&impl->cleanup_clients, &client->link); pw_map_for_each(&client->streams, client_free_stream, client); - pw_map_clear(&client->streams); if (client->source) pw_loop_destroy_source(impl->loop, client->source); @@ -5391,6 +5390,7 @@ static void client_free(struct client *client) client->disconnecting = true; pw_core_disconnect(client->core); } + pw_map_clear(&client->streams); free(client->default_sink); free(client->default_source); if (client->props)