mirror of
https://github.com/esphome/esphome.git
synced 2025-11-17 23:35:47 +00:00
[wifi] Free scan results memory after connection (saves up to 1.2KB RAM) (#11205)
This commit is contained in:
@@ -713,6 +713,12 @@ void WiFiComponent::check_connecting_finished() {
|
||||
this->state_ = WIFI_COMPONENT_STATE_STA_CONNECTED;
|
||||
this->num_retried_ = 0;
|
||||
|
||||
// Free scan results memory unless a component needs them
|
||||
if (!this->keep_scan_results_) {
|
||||
this->scan_result_.clear();
|
||||
this->scan_result_.shrink_to_fit();
|
||||
}
|
||||
|
||||
if (this->fast_connect_) {
|
||||
this->save_fast_connect_settings_();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user