diff options
Diffstat (limited to 'src/cull.cpp')
| -rw-r--r-- | src/cull.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cull.cpp b/src/cull.cpp index 4957773e2..b2cf536a5 100644 --- a/src/cull.cpp +++ b/src/cull.cpp @@ -127,7 +127,9 @@ void CullList::Apply() void ActionList::Run() { - for (auto* action : list) - action->Call(); + // IMPORTANT: we can't use a range-based for loop here as adding to the list + // may invalidate the list iterators. + for (size_t idx = 0; idx < list.size(); ++idx) + list[idx]->Call(); list.clear(); } |
