--- profiles/audio/hfp-hf.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/profiles/audio/hfp-hf.c b/profiles/audio/hfp-hf.c index e7bfe4f59..0fae3cd6f 100644 --- a/profiles/audio/hfp-hf.c +++ b/profiles/audio/hfp-hf.c @@ -1224,6 +1224,15 @@ static int hfp_connect(struct btd_service *service) return telephony_register_interface(dev->telephony); } +static void remove_calls(gpointer data, gpointer user_data) +{ + struct call *call = data; + struct hfp_device *dev = user_data; + + dev->calls = g_slist_remove(dev->calls, call); + telephony_call_unregister_interface(call); +} + static int hfp_disconnect(struct btd_service *service) { struct hfp_device *dev; @@ -1232,6 +1241,8 @@ static int hfp_disconnect(struct btd_service *service) dev = btd_service_get_user_data(service); + g_slist_foreach(dev->calls, remove_calls, dev); + if (dev->hf) hfp_hf_disconnect(dev->hf); -- 2.43.0