Dundee is not waiting to receive the NO CARRIER notification
to close the IO channel with oFono so that oFono is trying to
send a NO CARRIER although GAtServer is removed.
---
 src/emulator.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/emulator.c b/src/emulator.c
index c3165eb..cbee6ad 100644
--- a/src/emulator.c
+++ b/src/emulator.c
@@ -101,7 +101,14 @@ static void cleanup_ppp(struct ofono_emulator *em)
        em->pns_id = 0;
 
        g_at_server_resume(em->server);
-       g_at_server_send_final(em->server, G_AT_SERVER_RESULT_NO_CARRIER);
+
+       /*
+        * If GAtServer IO is lost, GAtServer can have been removed
+        * through emulator disconnect routine.
+        */
+       if (em->server != NULL)
+               g_at_server_send_final(em->server,
+                                       G_AT_SERVER_RESULT_NO_CARRIER);
 }
 
 static void ppp_disconnect(GAtPPPDisconnectReason reason, gpointer user_data)
-- 
1.7.5.4

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

Reply via email to