module-loopback: deactive both streams before destroying

First deactivate both streams so that they are not calling eachother
anymore and then destroy the streams.
This commit is contained in:
Wim Taymans 2022-12-05 16:05:37 +01:00
parent bc2cf226d7
commit 9f2abea480

View file

@ -513,11 +513,11 @@ static const struct pw_proxy_events core_proxy_events = {
static void impl_destroy(struct impl *impl) static void impl_destroy(struct impl *impl)
{ {
/* disconnect both streams before destroying any of them */ /* deactivate both streams before destroying any of them */
if (impl->capture) if (impl->capture)
pw_stream_disconnect(impl->capture); pw_stream_set_active(impl->capture, false);
if (impl->playback) if (impl->playback)
pw_stream_disconnect(impl->playback); pw_stream_set_active(impl->playback, false);
if (impl->capture) if (impl->capture)
pw_stream_destroy(impl->capture); pw_stream_destroy(impl->capture);