diff options
author | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2019-05-14 17:50:37 +0300 |
---|---|---|
committer | Tatiana Yan <tatiana.kondakova@gmail.com> | 2019-05-15 11:33:44 +0300 |
commit | a575fe24000b014a13ec1a72faca59c045d4fcc8 (patch) | |
tree | cc01fcda91092f02da733e6e8d82137c1a905c57 /routing/index_router.cpp | |
parent | d535b63e7c17b7dfb69bf60c9463b09718ccd8df (diff) |
Clearing handles after route building.
Diffstat (limited to 'routing/index_router.cpp')
-rw-r--r-- | routing/index_router.cpp | 10 |
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()) { |