diff options
author | Lev Dragunov <l.dragunov@corp.mail.ru> | 2015-08-20 14:01:34 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 03:01:56 +0300 |
commit | 6b808ef4abece30fda3e9260542fd10296e43476 (patch) | |
tree | 754b6dff00d367b6968ab4a2d236c30f07c24977 /routing | |
parent | 4411cb0606d16aee54678b9c3f5650394fda7d50 (diff) |
Pedestrian routing crash fix.
Diffstat (limited to 'routing')
-rw-r--r-- | routing/route.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/routing/route.cpp b/routing/route.cpp index 4ae404d2eb..42f40f4061 100644 --- a/routing/route.cpp +++ b/routing/route.cpp @@ -37,7 +37,7 @@ void Route::Swap(Route & rhs) m_router.swap(rhs.m_router); swap(m_routingSettings, rhs.m_routingSettings); m_poly.Swap(rhs.m_poly); - m_simplifiedPoly.Swap(m_simplifiedPoly); + m_simplifiedPoly.Swap(rhs.m_simplifiedPoly); m_name.swap(rhs.m_name); swap(m_currentTime, rhs.m_currentTime); swap(m_turns, rhs.m_turns); @@ -163,7 +163,7 @@ void Route::GetCurrentTurn(double & distanceToTurnMeters, turns::TurnItem & turn void Route::GetCurrentDirectionPoint(m2::PointD & pt) const { - if (m_routingSettings.m_keepPedestrianInfo) + if (m_routingSettings.m_keepPedestrianInfo && m_simplifiedPoly.IsValid()) m_simplifiedPoly.GetCurrentDirectionPoint(pt, kOnEndToleranceM); else m_poly.GetCurrentDirectionPoint(pt, kOnEndToleranceM); @@ -252,7 +252,7 @@ void Route::Update() // TODO (ldargunov) Rewrite dist f to distance in meters and avoid 0.00000 constants. SimplifyNearOptimal(20, m_poly.GetPolyline().Begin(), m_poly.GetPolyline().End(), 0.00000001, distFn, MakeBackInsertFunctor(points)); - m_simplifiedPoly = FollowedPolyline(points.begin(), points.end()); + FollowedPolyline(points.begin(), points.end()).Swap(m_simplifiedPoly); } else { |