From 7b129c1020d1a8303cb195241ab7d47b595f20a7 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 3 Jul 2020 16:10:46 +0200 Subject: [PATCH] sco: remove transport hooks on destroy --- spa/plugins/bluez5/sco-sink.c | 2 ++ spa/plugins/bluez5/sco-source.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/spa/plugins/bluez5/sco-sink.c b/spa/plugins/bluez5/sco-sink.c index aa0d8f308..ca1a814b2 100644 --- a/spa/plugins/bluez5/sco-sink.c +++ b/spa/plugins/bluez5/sco-sink.c @@ -1072,6 +1072,8 @@ static int impl_get_interface(struct spa_handle *handle, const char *type, void static int impl_clear(struct spa_handle *handle) { struct impl *this = (struct impl *) handle; + if (this->transport) + spa_hook_remove(&this->transport_listener); spa_system_close(this->data_system, this->timerfd); return 0; } diff --git a/spa/plugins/bluez5/sco-source.c b/spa/plugins/bluez5/sco-source.c index 569dca17c..f0788a273 100644 --- a/spa/plugins/bluez5/sco-source.c +++ b/spa/plugins/bluez5/sco-source.c @@ -978,6 +978,9 @@ static int impl_get_interface(struct spa_handle *handle, const char *type, void static int impl_clear(struct spa_handle *handle) { + struct impl *this = (struct impl *) handle; + if (this->transport) + spa_hook_remove(&this->transport_listener); return 0; }