fix(nvs_flash): delete leftover handles on partition deinit

This commit is contained in:
sonika.rathi
2026-07-24 13:21:30 +02:00
parent 256a6adf71
commit ff13da5e6c
3 changed files with 32 additions and 1 deletions
+2
View File
@@ -85,7 +85,9 @@ static esp_err_t close_handles_and_deinit(const char* part_name)
auto it = find_if(begin(s_nvs_handles), end(s_nvs_handles), belongs_to_part);
// Same as nvs_close(): erase from the list and delete the entry (frees NVSHandleSimple).
while (it != end(s_nvs_handles)) {
delete static_cast<NVSHandleEntry*>(it);
s_nvs_handles.erase(it);
it = find_if(begin(s_nvs_handles), end(s_nvs_handles), belongs_to_part);
}