if (_wifi_get_callback_count_from_handle_list(WIFI_SCAN_REQUEST_CB)) {
for (list = wifi_manager_handle_list; list; list = list->next) {
wifi_manager_handle_s *local_handle = (wifi_manager_handle_s *)list->data;
- if (local_handle->scan_request_cb)
- local_handle->scan_request_cb(error_code, local_handle->scan_request_user_data);
-
+ wifi_manager_scan_finished_cb cb = local_handle->scan_request_cb;
+ void* user_data = local_handle->scan_request_user_data;
local_handle->scan_request_cb = NULL;
local_handle->scan_request_user_data = NULL;
+
+ if (cb)
+ cb(error_code, user_data);
+
}
return;
}