Fix: Convert Huawei plugin to new world order
authorDenis Kenzior <denkenz@gmail.com>
Wed, 2 Dec 2009 23:55:53 +0000 (17:55 -0600)
committerDenis Kenzior <denkenz@gmail.com>
Thu, 3 Dec 2009 01:11:35 +0000 (19:11 -0600)
plugins/huawei.c

index 72298fb..50db2c5 100644 (file)
@@ -70,6 +70,7 @@ static void huawei_remove(struct ofono_modem *modem)
 
        ofono_modem_set_data(modem, NULL);
 
+       g_at_chat_unref(data->chat);
        g_free(data);
 }
 
@@ -150,6 +151,8 @@ static int huawei_disable(struct ofono_modem *modem)
        if (!data->chat)
                return 0;
 
+       g_at_chat_cancel_all(data->chat);
+       g_at_chat_unregister_all(data->chat);
        g_at_chat_send(data->chat, "AT+CFUN=0", NULL,
                                        cfun_disable, modem, NULL);