Fixed processing of the mwm deregistered notification during mwm updating.

This commit is contained in:
Daria Volvenkova 2018-07-16 14:34:51 +03:00 committed by Vlad Mihaylenko
parent 172f6b596f
commit 0d661d3deb
2 changed files with 14 additions and 1 deletions

View file

@ -609,6 +609,7 @@ bool Framework::OnCountryFileDelete(storage::TCountryId const & countryId, stora
auto const mwmId = m_model.GetDataSource().GetMwmIdByCountryFile(localFile->GetCountryFile());
m_model.DeregisterMap(platform::CountryFile(countryId));
deferredDelete = true;
// Notify managers in case of mwm deletion.
m_localAdsManager.OnMwmDeregistered(mwmId);
m_transitManager.OnMwmDeregistered(mwmId);
m_trafficManager.OnMwmDeregistered(mwmId);
@ -626,6 +627,15 @@ void Framework::OnMapDeregistered(platform::LocalCountryFile const & localFile)
m_storage.DeleteCustomCountryVersion(localFile);
};
auto const mwmId = m_model.GetDataSource().GetMwmIdByCountryFile(localFile.GetCountryFile());
if (mwmId.GetInfo())
{
// Notify managers in case of mwm updating.
m_localAdsManager.OnMwmDeregistered(mwmId);
m_transitManager.OnMwmDeregistered(mwmId);
m_trafficManager.OnMwmDeregistered(mwmId);
}
// Call action on thread in which the framework was created
// For more information look at comment for Observer class in mwm_set.hpp
if (m_storage.GetThreadChecker().CalledOnOriginalThread())

View file

@ -149,7 +149,6 @@ void TrafficManager::OnMwmDeregistered(MwmSet::MwmId const & mwmId)
lock_guard<mutex> lock(m_mutex);
ClearCache(mwmId);
}
Invalidate();
}
void TrafficManager::OnDestroyGLContext()
@ -447,6 +446,10 @@ void TrafficManager::ClearCache(MwmSet::MwmId const & mwmId)
}
m_mwmCache.erase(it);
m_trafficETags.erase(mwmId);
m_activeDrapeMwms.erase(mwmId);
m_activeRoutingMwms.erase(mwmId);
m_lastDrapeMwmsByRect.clear();
m_lastRoutingMwmsByRect.clear();
}
bool TrafficManager::IsEnabled() const