Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaria Volvenkova <d.volvenkova@corp.mail.ru>2017-05-26 19:00:31 +0300
committerGitHub <noreply@github.com>2017-05-26 19:00:31 +0300
commit40bf5c7a0f634d364ec3fa9a5738e69a79862fc0 (patch)
treed6775fa643a25dfbd566552ece1e563aaaa8183b
parente1b401be75126498fed53b1344532d44c4d3e1b6 (diff)
parent56bc20907a324e3a45582a28b45b9739dec98406 (diff)
Merge pull request #6138 from milchakov/traffic_manager_fixbeta-833
traffic manager map deregistered fix
-rw-r--r--indexer/mwm_set.hpp2
-rw-r--r--map/framework.cpp5
-rw-r--r--map/traffic_manager.cpp5
-rw-r--r--map/traffic_manager.hpp2
4 files changed, 7 insertions, 7 deletions
diff --git a/indexer/mwm_set.hpp b/indexer/mwm_set.hpp
index 9604f20e97..d6283c4ab1 100644
--- a/indexer/mwm_set.hpp
+++ b/indexer/mwm_set.hpp
@@ -239,7 +239,7 @@ public:
// Called when a map is updated to a newer version. Feel free to
// treat it as combined OnMapRegistered(newFile) +
- // OnMapRegistered(oldFile).
+ // OnMapDeregistered(oldFile).
virtual void OnMapUpdated(platform::LocalCountryFile const & /*newFile*/,
platform::LocalCountryFile const & /*oldFile*/) {}
diff --git a/map/framework.cpp b/map/framework.cpp
index beafc3f454..680fdf9de4 100644
--- a/map/framework.cpp
+++ b/map/framework.cpp
@@ -665,11 +665,9 @@ bool Framework::OnCountryFileDelete(storage::TCountryId const & countryId, stora
bool deferredDelete = false;
if (localFile)
{
- auto const mwmId = m_model.GetIndex().GetMwmIdByCountryFile(platform::CountryFile(countryId));
rect = m_infoGetter->GetLimitRectForLeaf(countryId);
m_model.DeregisterMap(platform::CountryFile(countryId));
deferredDelete = true;
- m_trafficManager.OnMwmDelete(mwmId);
m_localAdsManager.OnDeleteCountry(countryId);
}
InvalidateRect(rect);
@@ -691,6 +689,9 @@ void Framework::OnMapDeregistered(platform::LocalCountryFile const & localFile)
action();
else
GetPlatform().RunOnGuiThread(action);
+
+ auto const mwmId = m_model.GetIndex().GetMwmIdByCountryFile(localFile.GetCountryFile());
+ m_trafficManager.OnMwmDeregistered(mwmId);
}
bool Framework::HasUnsavedEdits(storage::TCountryId const & countryId)
diff --git a/map/traffic_manager.cpp b/map/traffic_manager.cpp
index e6c93f01f6..883edcbd34 100644
--- a/map/traffic_manager.cpp
+++ b/map/traffic_manager.cpp
@@ -141,7 +141,7 @@ void TrafficManager::SetCurrentDataVersion(int64_t dataVersion)
m_currentDataVersion = dataVersion;
}
-void TrafficManager::OnMwmDelete(MwmSet::MwmId const & mwmId)
+void TrafficManager::OnMwmDeregistered(MwmSet::MwmId const & mwmId)
{
if (!IsEnabled())
return;
@@ -237,8 +237,7 @@ void TrafficManager::ThreadRoutine()
{
for (auto const & mwm : mwms)
{
- auto const & mwmInfo = mwm.GetInfo();
- if (!mwmInfo)
+ if (!mwm.IsAlive())
continue;
traffic::TrafficInfo info(mwm, m_currentDataVersion);
diff --git a/map/traffic_manager.hpp b/map/traffic_manager.hpp
index d2116f70df..40a79e839f 100644
--- a/map/traffic_manager.hpp
+++ b/map/traffic_manager.hpp
@@ -79,7 +79,7 @@ public:
void OnDestroyGLContext();
void OnRecoverGLContext();
- void OnMwmDelete(MwmSet::MwmId const & mwmId);
+ void OnMwmDeregistered(MwmSet::MwmId const & mwmId);
void OnEnterForeground();
void OnEnterBackground();