Crashing on shipping build, but not on development build.

Do not modify the size of an array while iterating on it: