Skip to content

Don't invalidate iterators while using range-for

Ahmad Samir requested to merge work/ahmad/iterators into master

Component's destructor will remove itself from m_components, which would invalidate iterators; instead delete after the for-loop. Thanks for Fabian Vogt for pointing out the exact issue.

Also mark that method as non const, deleteing a Component modifies m_components.

CCBUG: 437364

Merge request reports