diff --git a/frameworks/native/rdb/src/rdb_store_manager.cpp b/frameworks/native/rdb/src/rdb_store_manager.cpp index b71bab3c8..225975368 100644 --- a/frameworks/native/rdb/src/rdb_store_manager.cpp +++ b/frameworks/native/rdb/src/rdb_store_manager.cpp @@ -66,11 +66,11 @@ std::shared_ptr RdbStoreManager::GetStoreFromCache(const RdbStoreC } std::shared_ptr rdbStore = it->second.lock(); if (rdbStore == nullptr) { - storeCache_.erase(path); + storeCache_.erase(it); return nullptr; } if (!(rdbStore->GetConfig() == config)) { - storeCache_.erase(path); + storeCache_.erase(it); LOG_INFO("app[%{public}s:%{public}s] path[%{public}s]" " cfg[%{public}d,%{public}d,%{public}d,%{public}d,%{public}d,%{public}d,%{public}d,%{public}s]" " %{public}s",