diff --git a/main/io/nvs_handler.cpp b/main/io/nvs_handler.cpp index 7aed74d..f433919 100644 --- a/main/io/nvs_handler.cpp +++ b/main/io/nvs_handler.cpp @@ -129,6 +129,7 @@ esp_err_t NVSStorageHandler::process_all(KeyValueProcessor processor, void* arg) // call the processor with the key and value std::string key_str = info.key; processor(arg, key_str, this->get(key_str)); + nvs_close(temp_handle); } return ESP_OK; } @@ -156,6 +157,7 @@ esp_err_t NVSStorageHandler::process_filtered(const std::string& key_prefix, Key } // call the processor with the key and value processor(arg, std::string(info.key), this->get(std::string(info.key))); + nvs_close(temp_handle); } } return ESP_OK; @@ -186,6 +188,7 @@ esp_err_t NVSStorageHandler::process_filtered(FilterFunc filter_func, KeyValuePr } // call the processor with the key and value processor(arg, key_str, this->get(key_str)); + nvs_close(temp_handle); } } return ESP_OK;