diff --git a/Source/Contents/Navigation/NavigationManager.h b/Source/Contents/Navigation/NavigationManager.h index 174f3d2b3..4a8766cff 100644 --- a/Source/Contents/Navigation/NavigationManager.h +++ b/Source/Contents/Navigation/NavigationManager.h @@ -45,6 +45,13 @@ struct NaviDataEntry { // INLINED NaviDataEntry(int previous, CNavi_Link* link, int cost) : previous(previous), link(link), cost(cost) {} + // INLINED + ~NaviDataEntry() { + this->previous = -1; + this->link = nullptr; + this->cost = 0; + } + void Reset(); void Init(); int GetPrevious() const; diff --git a/Source/Contents/Navigation/NavigationRoute.cpp b/Source/Contents/Navigation/NavigationRoute.cpp index c29c7ddd2..c7e2f1a18 100644 --- a/Source/Contents/Navigation/NavigationRoute.cpp +++ b/Source/Contents/Navigation/NavigationRoute.cpp @@ -979,11 +979,6 @@ void CNaviData::Clear() { this->range = 50000; this->endLinks.clear(); - for (NaviDataEntry& entry : this->entries) { - entry.previous = -1; - entry.link = nullptr; - entry.cost = 0; - } this->entries.clear(); }