ofono: Destroy network_hash when disconnecting
authorYu A Wang <yu.a.wang@intel.com>
Sat, 30 Jul 2011 03:02:56 +0000 (23:02 -0400)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 4 Aug 2011 14:31:24 +0000 (16:31 +0200)
plugins/ofono.c

index ea4692f..2bf777d 100644 (file)
@@ -1596,12 +1596,15 @@ static void ofono_disconnect(DBusConnection *connection, void *user_data)
 {
        DBG("connection %p", connection);
 
-       if (modem_hash == NULL)
-               return;
-
-       g_hash_table_destroy(modem_hash);
+       if (modem_hash != NULL) {
+               g_hash_table_destroy(modem_hash);
+               modem_hash = NULL;
+       }
 
-       modem_hash = NULL;
+       if (network_hash != NULL) {
+               g_hash_table_destroy(network_hash);
+               network_hash = NULL;
+       }
 }
 
 static gboolean modem_changed(DBusConnection *connection, DBusMessage *message,