From 75a67bca1d3921ecfe8cd2f9531d2746c3318965 Mon Sep 17 00:00:00 2001 From: Daria Volvenkova Date: Tue, 26 Dec 2017 19:29:58 +0300 Subject: [PATCH] Fixed crash in transit route recovering. --- map/routing_manager.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/map/routing_manager.cpp b/map/routing_manager.cpp index 670e806010..3017107a99 100644 --- a/map/routing_manager.cpp +++ b/map/routing_manager.cpp @@ -977,9 +977,9 @@ void RoutingManager::SetDrapeEngine(ref_ptr engine, bool is3dAl symbols.push_back(typePair.second + "-l"); } m_drapeEngine.SafeCall(&df::DrapeEngine::RequestSymbolsSize, symbols, - [this](std::vector const & sizes) + [this, is3dAllowed](std::vector const & sizes) { - GetPlatform().RunTask(Platform::Thread::Gui, [this, sizes]() + GetPlatform().RunTask(Platform::Thread::Gui, [this, is3dAllowed, sizes]() { auto it = kTransitSymbols.begin(); for (size_t i = 0; i < sizes.size(); i += 3) @@ -989,16 +989,16 @@ void RoutingManager::SetDrapeEngine(ref_ptr engine, bool is3dAl m_transitSymbolSizes[it->second + "-l"] = sizes[i + 2]; ++it; } + + // In case of the engine reinitialization recover route. + if (IsRoutingActive()) + { + InsertRoute(*m_routingSession.GetRoute()); + if (is3dAllowed && m_routingSession.IsFollowing()) + m_drapeEngine.SafeCall(&df::DrapeEngine::EnablePerspective); + } }); }); - - // In case of the engine reinitialization recover route. - if (IsRoutingActive()) - { - InsertRoute(*m_routingSession.GetRoute()); - if (is3dAllowed && m_routingSession.IsFollowing()) - m_drapeEngine.SafeCall(&df::DrapeEngine::EnablePerspective); - } } bool RoutingManager::HasRouteAltitude() const