This patch removes a registered Handsfree Audio Card when the local host
requests disconnection of the service level connection.
---
 plugins/hfp_hf_bluez5.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/plugins/hfp_hf_bluez5.c b/plugins/hfp_hf_bluez5.c
index 26946af..494f33c 100644
--- a/plugins/hfp_hf_bluez5.c
+++ b/plugins/hfp_hf_bluez5.c
@@ -427,6 +427,12 @@ static DBusMessage *profile_disconnection(DBusConnection 
*conn,
        hfp = ofono_modem_get_data(modem);
        info = &hfp->info;
 
+       if (hfp->card) {
+               ofono_handsfree_card_remove(hfp->card);
+               g_free(hfp->card);
+               hfp->card = NULL;
+       }
+
        g_at_chat_unref(info->chat);
        info->chat = NULL;
 
-- 
1.7.11.7

_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono

Reply via email to