1
0
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:
J. Nick Koston
2025-10-14 14:25:31 -10:00
committed by GitHub
parent 88d223d03a
commit d75ae357c2
4 changed files with 36 additions and 2 deletions

View File

@@ -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_();
}