!827 getLastLocation 更新数据异常

Merge pull request !827 from smilebear/master
This commit is contained in:
openharmony_ci 2024-08-14 08:56:10 +00:00 committed by Gitee
commit 280dafb56d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -306,7 +306,7 @@ void ReportManager::UpdateLastLocation(const std::unique_ptr<Location>& location
int currentUserId = 0;
if (CommonUtils::GetCurrentUserId(currentUserId)) {
std::unique_lock<std::mutex> lock(lastLocationMutex_);
lastLocationsMap_.insert(std::make_pair(currentUserId, std::make_shared<Location>(*location)));
lastLocationsMap_[currentUserId] = std::make_shared<Location>(*location);
}
}