Ensure to disconnect from devices and networks
authorMarcel Holtmann <marcel@holtmann.org>
Fri, 17 Jul 2009 14:55:42 +0000 (16:55 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 17 Jul 2009 14:55:42 +0000 (16:55 +0200)
src/device.c
src/service.c

index 248c041..6c64683 100644 (file)
@@ -1443,9 +1443,7 @@ int __connman_device_disconnect(struct connman_device *device)
        while (g_hash_table_iter_next(&iter, &key, &value) == TRUE) {
                struct connman_network *network = value;
 
-               if (connman_network_get_connected(network) == TRUE ||
-                               connman_network_get_associating(network) == TRUE)
-                       __connman_network_disconnect(network);
+               __connman_network_disconnect(network);
        }
 
        if (device->driver && device->driver->disconnect)
index 014ec9e..497b027 100644 (file)
@@ -1319,6 +1319,8 @@ done:
                goto failed;
        }
 
+       __connman_device_disconnect(device);
+
        if (passphrase != NULL) {
                g_free(service->passphrase);
                service->passphrase = g_strdup(passphrase);