mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
Fixed a bad iterator
This commit is contained in:
parent
08939fad16
commit
ee6d7813a6
@ -2730,17 +2730,21 @@ detach_one_stage(NodePathComponent *child, int pipeline_stage,
|
|||||||
Down::iterator di;
|
Down::iterator di;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
Down &down = *cdata_parent->modify_down();
|
Down &down = *cdata_parent->modify_down();
|
||||||
for (di = down.begin(); di != down.end() && !found; ++di) {
|
for (di = down.begin(); di != down.end(); ++di) {
|
||||||
if ((*di).get_child() == child_node) {
|
if ((*di).get_child() == child_node) {
|
||||||
down.erase(di);
|
down.erase(di);
|
||||||
found = true;
|
found = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Down &stashed = *cdata_parent->modify_stashed();
|
if (!found) {
|
||||||
for (di = stashed.begin(); di != stashed.end() && !found; ++di) {
|
Down &stashed = *cdata_parent->modify_stashed();
|
||||||
if ((*di).get_child() == child_node) {
|
for (di = stashed.begin(); di != stashed.end(); ++di) {
|
||||||
stashed.erase(di);
|
if ((*di).get_child() == child_node) {
|
||||||
found = true;
|
stashed.erase(di);
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nassertv(found);
|
nassertv(found);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user