summaryrefslogtreecommitdiffstats
path: root/plugins/hso.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/hso.c')
-rw-r--r--plugins/hso.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/hso.c b/plugins/hso.c
index 6293d84f..e30a2c5e 100644
--- a/plugins/hso.c
+++ b/plugins/hso.c
@@ -72,6 +72,7 @@ static void hso_remove(struct ofono_modem *modem)
ofono_modem_set_data(modem, NULL);
+ g_at_chat_unref(data->control);
g_free(data);
}
@@ -166,10 +167,6 @@ static void cfun_disable(gboolean ok, GAtResult *result, gpointer user_data)
g_at_chat_unref(data->control);
data->control = NULL;
- g_at_chat_shutdown(data->app);
- g_at_chat_unref(data->app);
- data->app = NULL;
-
if (ok)
ofono_modem_set_powered(modem, FALSE);
}
@@ -183,6 +180,13 @@ static int hso_disable(struct ofono_modem *modem)
if (!data->control)
return 0;
+ g_at_chat_cancel_all(data->control);
+ g_at_chat_unregister_all(data->control);
+
+ g_at_chat_shutdown(data->app);
+ g_at_chat_unref(data->app);
+ data->app = NULL;
+
g_at_chat_send(data->control, "AT+CFUN=0", none_prefix,
cfun_disable, modem, NULL);