From 21b9d4f0177325d4f0fd07fd21a70f7abcf98877 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Wed, 2 Dec 2009 17:55:40 -0600 Subject: [PATCH] Fix: Convert HSO plugin to new world order --- plugins/hso.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/hso.c b/plugins/hso.c index 6293d84..e30a2c5 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); -- 2.7.4