summaryrefslogtreecommitdiff
path: root/src/device.c
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2011-07-25 16:24:35 +0200
committerMarcel Holtmann <marcel@holtmann.org>2011-07-26 01:22:51 +0200
commitba045ac4c9bf8d84d9ec2679be505bb51d098ab6 (patch)
treea63b31f7bee8d40fd29483ac25093342a26cc2cf /src/device.c
parent52c76529ae6f1aca786111e9343b75d5535097c1 (diff)
downloadconnman-ba045ac4c9bf8d84d9ec2679be505bb51d098ab6.tar.gz
connman-ba045ac4c9bf8d84d9ec2679be505bb51d098ab6.tar.bz2
connman-ba045ac4c9bf8d84d9ec2679be505bb51d098ab6.zip
device: Reorder cleanup
If free_network is called before the driver->disable() callback the device has been removed from the networking structure.
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/device.c b/src/device.c
index 39c3fc01..e5bd84db 100644
--- a/src/device.c
+++ b/src/device.c
@@ -271,8 +271,6 @@ int __connman_device_disable(struct connman_device *device)
clear_scan_trigger(device);
- g_hash_table_remove_all(device->networks);
-
err = device->driver->disable(device);
if (err < 0 && err != -EALREADY) {
if (err == -EINPROGRESS)
@@ -280,6 +278,8 @@ int __connman_device_disable(struct connman_device *device)
return err;
}
+ g_hash_table_remove_all(device->networks);
+
device->connections = 0;
device->powered_pending = FALSE;