Avoid using invalidated iterators.
The iterator implicit in the ranged for() can be invalidated by the
eraseFromParent() call. Trying to advance it constitutes a use-after-free.
Found by valgrind.
The iterator implicit in the ranged for() can be invalidated by the
eraseFromParent() call. Trying to advance it constitutes a use-after-free.
Found by valgrind.