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:
authorVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2019-05-14 17:50:37 +0300
committerTatiana Yan <tatiana.kondakova@gmail.com>2019-05-15 11:33:44 +0300
commita575fe24000b014a13ec1a72faca59c045d4fcc8 (patch)
treecc01fcda91092f02da733e6e8d82137c1a905c57 /routing/index_router.cpp
parentd535b63e7c17b7dfb69bf60c9463b09718ccd8df (diff)
Clearing handles after route building.
Diffstat (limited to 'routing/index_router.cpp')
-rw-r--r--routing/index_router.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/routing/index_router.cpp b/routing/index_router.cpp
index e9130049f2..a0ad8573c2 100644
--- a/routing/index_router.cpp
+++ b/routing/index_router.cpp
@@ -302,6 +302,12 @@ bool IndexRouter::FindBestSegment(m2::PointD const & point, m2::PointD const & d
dummy /* best segment is almost codirectional */);
}
+void IndexRouter::ClearState()
+{
+ m_roadGraph.ClearState();
+ m_directionsEngine->Clear();
+}
+
RouterResultCode IndexRouter::CalculateRoute(Checkpoints const & checkpoints,
m2::PointD const & startDirection,
bool adjustToPrevRoute,
@@ -323,6 +329,10 @@ RouterResultCode IndexRouter::CalculateRoute(Checkpoints const & checkpoints,
try
{
+ SCOPE_GUARD(featureRoadGraphClear, [this]{
+ this->ClearState();
+ });
+
if (adjustToPrevRoute && m_lastRoute && m_lastFakeEdges &&
finalPoint == m_lastRoute->GetFinish())
{