From 45c99cd4872ee8c335aee8b9282cc7d2a00c8cba Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 28 Sep 2023 11:22:46 +0200 Subject: [PATCH] impl-link: recalc graph after destroy prepared link Get and use the prepared state of the link *before* unpreparing the link as part of the destroy. --- src/pipewire/impl-link.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pipewire/impl-link.c b/src/pipewire/impl-link.c index 675fab131..e205efe3e 100644 --- a/src/pipewire/impl-link.c +++ b/src/pipewire/impl-link.c @@ -1545,6 +1545,7 @@ SPA_EXPORT void pw_impl_link_destroy(struct pw_impl_link *link) { struct impl *impl = SPA_CONTAINER_OF(link, struct impl, this); + bool was_prepared = link->prepared; pw_log_debug("%p: destroy", impl); pw_log_info("(%s) destroy", link->name); @@ -1570,7 +1571,7 @@ void pw_impl_link_destroy(struct pw_impl_link *link) pw_global_destroy(link->global); } - if (link->prepared) + if (was_prepared) pw_context_recalc_graph(link->context, "link destroy"); pw_log_debug("%p: free", impl);