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
This commit is contained in:
Wim Taymans 2021-03-17 16:28:21 +01:00
parent a96d8aa1aa
commit 24d795e9a4

View file

@ -5357,7 +5357,6 @@ static void client_disconnect(struct client *client)
spa_list_append(&impl->cleanup_clients, &client->link); spa_list_append(&impl->cleanup_clients, &client->link);
pw_map_for_each(&client->streams, client_free_stream, client); pw_map_for_each(&client->streams, client_free_stream, client);
pw_map_clear(&client->streams);
if (client->source) if (client->source)
pw_loop_destroy_source(impl->loop, client->source); pw_loop_destroy_source(impl->loop, client->source);
@ -5391,6 +5390,7 @@ static void client_free(struct client *client)
client->disconnecting = true; client->disconnecting = true;
pw_core_disconnect(client->core); pw_core_disconnect(client->core);
} }
pw_map_clear(&client->streams);
free(client->default_sink); free(client->default_sink);
free(client->default_source); free(client->default_source);
if (client->props) if (client->props)