| 414 | } |
| 415 | |
| 416 | void TrafficManager::ClearCache(MwmSet::MwmId const & mwmId) |
| 417 | { |
| 418 | auto const it = m_mwmCache.find(mwmId); |
| 419 | if (it == m_mwmCache.end()) |
| 420 | return; |
| 421 | |
| 422 | if (it->second.m_isLoaded) |
| 423 | { |
| 424 | ASSERT_GREATER_OR_EQUAL(m_currentCacheSizeBytes, it->second.m_dataSize, ()); |
| 425 | m_currentCacheSizeBytes -= it->second.m_dataSize; |
| 426 | |
| 427 | m_drapeEngine.SafeCall(&df::DrapeEngine::ClearTrafficCache, mwmId); |
| 428 | |
| 429 | GetPlatform().RunTask(Platform::Thread::Gui, [this, mwmId]() { m_observer.OnTrafficInfoRemoved(mwmId); }); |
| 430 | } |
| 431 | m_mwmCache.erase(it); |
| 432 | m_trafficETags.erase(mwmId); |
| 433 | m_activeDrapeMwms.erase(mwmId); |
| 434 | m_activeRoutingMwms.erase(mwmId); |
| 435 | m_lastDrapeMwmsByRect.clear(); |
| 436 | m_lastRoutingMwmsByRect.clear(); |
| 437 | } |
| 438 | |
| 439 | bool TrafficManager::IsEnabled() const |
| 440 | { |
no test coverage detected