diff --git a/map/routing_manager.cpp b/map/routing_manager.cpp index 659f758f5b..bb7d1d1bea 100644 --- a/map/routing_manager.cpp +++ b/map/routing_manager.cpp @@ -438,11 +438,11 @@ void RoutingManager::RemoveRoute(bool deactivateFollowing) } else { - auto const subroutes = GetSubrouteIds(); df::DrapeEngineLockGuard lock(m_drapeEngine); if (lock) { - for (auto const & subrouteId : subroutes) + lock_guard l(m_drapeSubroutesMutex); + for (auto const & subrouteId : m_drapeSubroutes) lock.Get()->RemoveSubroute(subrouteId, false /* deactivateFollowing */); } } @@ -1339,20 +1339,13 @@ TransitRouteInfo RoutingManager::GetTransitRouteInfo() const return m_transitRouteInfo; } -vector RoutingManager::GetSubrouteIds() const -{ - lock_guard lock(m_drapeSubroutesMutex); - return m_drapeSubroutes; -} - void RoutingManager::SetSubroutesVisibility(bool visible) { - auto const subroutes = GetSubrouteIds(); - df::DrapeEngineLockGuard lock(m_drapeEngine); if (!lock) return; - for (auto const & subrouteId : subroutes) + lock_guard l(m_drapeSubroutesMutex); + for (auto const & subrouteId : m_drapeSubroutes) lock.Get()->SetSubrouteVisibility(subrouteId, visible); } diff --git a/map/routing_manager.hpp b/map/routing_manager.hpp index 10669c1b66..90644138a2 100644 --- a/map/routing_manager.hpp +++ b/map/routing_manager.hpp @@ -283,7 +283,6 @@ private: m2::RectD ShowPreviewSegments(std::vector const & routePoints); void HidePreviewSegments(); - std::vector GetSubrouteIds() const; void SetSubroutesVisibility(bool visible); void CancelRecommendation(Recommendation recommendation);