mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-27 07:00:12 -05:00
context: destroy data-loop in free
Just stop the data-loop before destroying the modules because they might still try to access it. Destroy the data-loop in the free phase instead. Fixes a valgrind error where module-rt tries to clear the thread-utils, which causes the context to try to clear the thread-utils on the already freed data-loop.
This commit is contained in:
parent
4a5129bdb4
commit
da10a2ad60
1 changed files with 4 additions and 1 deletions
|
|
@ -464,7 +464,7 @@ void pw_context_destroy(struct pw_context *context)
|
||||||
pw_resource_destroy(resource);
|
pw_resource_destroy(resource);
|
||||||
|
|
||||||
if (context->data_loop_impl)
|
if (context->data_loop_impl)
|
||||||
pw_data_loop_destroy(context->data_loop_impl);
|
pw_data_loop_stop(context->data_loop_impl);
|
||||||
|
|
||||||
spa_list_consume(module, &context->module_list, link)
|
spa_list_consume(module, &context->module_list, link)
|
||||||
pw_impl_module_destroy(module);
|
pw_impl_module_destroy(module);
|
||||||
|
|
@ -481,6 +481,9 @@ void pw_context_destroy(struct pw_context *context)
|
||||||
pw_log_debug("%p: free", context);
|
pw_log_debug("%p: free", context);
|
||||||
pw_context_emit_free(context);
|
pw_context_emit_free(context);
|
||||||
|
|
||||||
|
if (context->data_loop_impl)
|
||||||
|
pw_data_loop_destroy(context->data_loop_impl);
|
||||||
|
|
||||||
if (context->pool)
|
if (context->pool)
|
||||||
pw_mempool_destroy(context->pool);
|
pw_mempool_destroy(context->pool);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue