Skip to content

Commit

Permalink
fixing cleanup crash fix #12223
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Dec 5, 2022
1 parent fb62c06 commit ae8fc1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/netbuild/NBEdgeCont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,10 @@ NBEdgeCont::extract(NBDistrictCont& dc, NBEdge* edge, bool remember) {
if (remember) {
const auto& prevExtracted = myExtractedEdges.find(edge->getID());
if (prevExtracted != myExtractedEdges.end()) {
myEdgeCemetery.push_back(prevExtracted->second);
prevExtracted->second = edge;
if (edge != prevExtracted->second) {
myEdgeCemetery.insert(prevExtracted->second);
prevExtracted->second = edge;
}
} else {
myExtractedEdges[edge->getID()] = edge;
}
Expand Down
2 changes: 1 addition & 1 deletion src/netbuild/NBEdgeCont.h
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ class NBEdgeCont {
EdgeCont myExtractedEdges;

/// @brief The edges which got extracted twice but may still be referenced somewhere TODO smart_ptr?
EdgeVector myEdgeCemetery;
std::set<NBEdge*> myEdgeCemetery;

/// @brief The ids of ignored edges
std::set<std::string> myIgnoredEdges;
Expand Down

0 comments on commit ae8fc1d

Please sign in to comment.