After looking at the docs for vector/iterator I think that the iterator is not a good choice for this case.
If I were you, I'd replace it with a simple index variable.
Indeed, this idea also comes to my mind, but that need a lot of code changes, I'm not fully understand the ccmanager.h/cpp, so let's do it step by step. Also, I need Alpha's comment.
Also, I want to know whether it fixes the crash issue. Since I don't have this crash in my computer even without this patch.