Merge pull request #26015 from hedin-hiervard/master
fixed AStar improper point deletion (leads to crash)
This commit is contained in:
commit
132e2f458d
|
@ -97,11 +97,14 @@ void AStar::remove_point(int p_id) {
|
||||||
|
|
||||||
Point *p = points[p_id];
|
Point *p = points[p_id];
|
||||||
|
|
||||||
for (Set<Point *>::Element *E = p->neighbours.front(); E; E = E->next()) {
|
Map<int, Point *>::Element *PE = points.front();
|
||||||
|
while (PE) {
|
||||||
Segment s(p_id, E->get()->id);
|
for (Set<Point *>::Element *E = PE->get()->neighbours.front(); E; E = E->next()) {
|
||||||
segments.erase(s);
|
Segment s(p_id, E->get()->id);
|
||||||
E->get()->neighbours.erase(p);
|
segments.erase(s);
|
||||||
|
E->get()->neighbours.erase(p);
|
||||||
|
}
|
||||||
|
PE = PE->next();
|
||||||
}
|
}
|
||||||
|
|
||||||
memdelete(p);
|
memdelete(p);
|
||||||
|
|
Loading…
Reference in New Issue