diff --git a/wifi/1.3/default/wifi.cpp b/wifi/1.3/default/wifi.cpp index 2f21819dbc..4229d352d5 100644 --- a/wifi/1.3/default/wifi.cpp +++ b/wifi/1.3/default/wifi.cpp @@ -124,6 +124,8 @@ WifiStatus Wifi::startInternal() { } } LOG(ERROR) << "Wifi HAL start failed"; + // Clear the event callback objects since the HAL start failed. + event_cb_handler_.invalidate(); } return wifi_status; } @@ -158,6 +160,8 @@ WifiStatus Wifi::stopInternal( } LOG(ERROR) << "Wifi HAL stop failed"; } + // Clear the event callback objects since the HAL is now stopped. + event_cb_handler_.invalidate(); return wifi_status; }