context: destroy clients first

Destroy clients before trying to remove nodes. If the clients are
still connected they might try to react to the removed nodes.
This commit is contained in:
Wim Taymans 2020-09-30 12:01:46 +02:00
parent 664ecbefee
commit bc35221210

View file

@ -347,6 +347,7 @@ void pw_context_destroy(struct pw_context *context)
{
struct impl *impl = SPA_CONTAINER_OF(context, struct impl, this);
struct pw_global *global;
struct pw_impl_client *client;
struct pw_impl_module *module;
struct pw_impl_device *device;
struct pw_core *core;
@ -361,6 +362,9 @@ void pw_context_destroy(struct pw_context *context)
spa_list_consume(core, &context->core_list, link)
pw_core_disconnect(core);
spa_list_consume(client, &context->client_list, link)
pw_impl_client_destroy(client);
spa_list_consume(node, &context->node_list, link)
pw_impl_node_destroy(node);