Merge pull request #3819 from BennyE/issue3663
Fix for issue 3663 by returning early if no scan was started before s…
This commit is contained in:
commit
a1f773d9ed
|
@ -105,6 +105,10 @@ mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self) {
|
void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self) {
|
||||||
|
// Return early if self->current_scan is NULL to avoid hang
|
||||||
|
if (self->current_scan == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Free the memory used to store the found aps.
|
// Free the memory used to store the found aps.
|
||||||
wifi_scannednetworks_deinit(self->current_scan);
|
wifi_scannednetworks_deinit(self->current_scan);
|
||||||
self->current_scan = NULL;
|
self->current_scan = NULL;
|
||||||
|
|
Loading…
Reference in New Issue