Now that we have a function that takes care of free'ing that structure
we should use it.
---
 plugins/hfp_hf_bluez4.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/plugins/hfp_hf_bluez4.c b/plugins/hfp_hf_bluez4.c
index b0aa1aa..d00e019 100644
--- a/plugins/hfp_hf_bluez4.c
+++ b/plugins/hfp_hf_bluez4.c
@@ -109,8 +109,8 @@ static void slc_failed(gpointer userdata)
        ofono_error("Service level connection failed");
        ofono_modem_set_powered(modem, FALSE);
 
-       g_at_chat_unref(data->info->chat);
-       data->info->chat = NULL;
+       hfp_slc_info_free(data->info);
+       data->info = NULL;
 }
 
 static void hfp_disconnected_cb(gpointer user_data)
@@ -120,8 +120,8 @@ static void hfp_disconnected_cb(gpointer user_data)
 
        ofono_modem_set_powered(modem, FALSE);
 
-       g_at_chat_unref(data->info->chat);
-       data->info->chat = NULL;
+       hfp_slc_info_free(data->info);
+       data->info = NULL;
 }
 
 /* either oFono or Phone could request SLC connection */
@@ -369,6 +369,8 @@ static void hfp_remove(struct ofono_modem *modem)
                                        HFP_AGENT_INTERFACE))
                hfp_unregister_ofono_handsfree(modem);
 
+       hfp_slc_info_free(data->info);
+
        g_free(data->handsfree_address);
        g_free(data->handsfree_path);
        g_free(data);
@@ -463,8 +465,8 @@ static int hfp_disable(struct ofono_modem *modem)
 
        DBG("%p", modem);
 
-       g_at_chat_unref(data->info->chat);
-       data->info->chat = NULL;
+       hfp_slc_info_free(data->info);
+       data->info = NULL;
 
        if (data->agent_registered) {
                status = bluetooth_send_with_reply(data->handsfree_path,
-- 
1.8.1.1

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

Reply via email to