diff --git a/src/device.c b/src/device.c index b398dd05..4eac011d 100644 --- a/src/device.c +++ b/src/device.c @@ -400,8 +400,6 @@ static bool new_scan_results(uint32_t wiphy_id, uint32_t ifindex, process_bss(device, bss, &now); } - l_hashmap_foreach_remove(device->networks, process_network, device); - if (device->connected_bss) { struct scan_bss *bss; @@ -420,6 +418,8 @@ static bool new_scan_results(uint32_t wiphy_id, uint32_t ifindex, device->connected_bss = bss; } + l_hashmap_foreach_remove(device->networks, process_network, device); + l_queue_destroy(device->old_bss_list, bss_free); device->old_bss_list = NULL;