diff options
author | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2016-12-03 12:19:09 +0300 |
---|---|---|
committer | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2016-12-03 12:19:09 +0300 |
commit | 3f7b61e52e1bcf36987a32baf0abbb03d6671ea0 (patch) | |
tree | ddebfb4ef1c88fd02e7c4bf3cc6120937eeb1fad /map | |
parent | 31247a70d4bf843e416ffe0fced127a8a17c6369 (diff) |
Reducing size of m_currentCacheSizeBytes twice when mwm is removed from cache and minor fixes.
Diffstat (limited to 'map')
-rw-r--r-- | map/traffic_manager.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/map/traffic_manager.cpp b/map/traffic_manager.cpp index 280bfa7d50..01e317d0f6 100644 --- a/map/traffic_manager.cpp +++ b/map/traffic_manager.cpp @@ -322,7 +322,6 @@ void TrafficManager::OnTrafficDataResponse(traffic::TrafficInfo && info) // Note. It's necessary to multiply by two because routing and rendering use separate caches. size_t const dataSize = 2 * info.GetColoring().size() * kElementSize; - it->second.m_isLoaded = true; m_currentCacheSizeBytes += (dataSize - it->second.m_dataSize); it->second.m_dataSize = dataSize; CheckCacheSize(); @@ -354,7 +353,8 @@ void TrafficManager::CheckCacheSize() auto const it = m_mwmCache.find(mwmId); if (it->second.m_isLoaded) { - m_currentCacheSizeBytes -= it->second.m_dataSize; + // Note. It's necessary to multiply by two because routing and rendering use separate caches. + m_currentCacheSizeBytes -= 2 * it->second.m_dataSize; m_drapeEngine->ClearTrafficCache(mwmId); m_observer.OnTrafficInfoRemoved(mwmId); } |