Description: Sometimes Wi-Fi device reference didn't set to zero
when Wi-Fi is powered off like below.
src/device.c:connman_device_ref_debug() 0xb7fd8ae0 ref 2 by plugins/wifi.c:1434:wifi_probe()
src/device.c:connman_device_ref_debug() 0xb7fd8ae0 ref 3 by plugins/wifi.c:3183:wifi_scan()
src/device.c:connman_device_ref_debug() 0xb7fd8ae0 ref 4 by plugins/wifi.c:2313:start_autoscan()
src/device.c:connman_device_unref_debug() 0xb7fd8ae0 ref 3 by plugins/wifi.c:1500:reset_autoscan()
src/device.c:connman_device_unref_debug() 0xb7fd8ae0 ref 2 by plugins/wifi.c:1606:wifi_remove()
src/device.c:connman_device_unref_debug() 0xb7fd8ae0 ref 1 by src/detect.c:106:detect_dellink()
src/device.c:connman_device_ref_debug() 0xb7fd8ae0 ref 2 by plugins/wifi.c:1434:wifi_probe()
src/device.c:connman_device_ref_debug() 0xb7fcce88 ref 2 by plugins/wifi.c:1434:wifi_probe()
src/device.c:connman_device_unref_debug() 0xb7fcce88 ref 1 by plugins/wifi.c:1606:wifi_remove()
src/device.c:connman_device_unref_debug() 0xb7fcce88 ref 0 by src/detect.c:106:detect_dellink()
Change-Id: I52783152a5dd581d1af072aa5f3a0db92e8d622a
Signed-off-by: Yu jiung <jiung.yu@samsung.com>
if (wifi->pending_network)
wifi->pending_network = NULL;
+#if !defined TIZEN_EXT
stop_autoscan(device);
+#endif
if (connman_device_get_scanning(device, CONNMAN_SERVICE_TYPE_P2P)) {
g_source_remove(wifi->p2p_find_timeout);
connman_device_unref(wifi->device);
}
+#if defined TIZEN_EXT
+ stop_autoscan(device);
+#endif
+
remove_networks(device, wifi);
remove_peers(wifi);