Hej,

You're right, this is the problem.
Try "i++" instead of "++i" in line 10.

If you use ++i, the value in i will be incremented before the body of the loop is executed, leading to a delete with invalid parameter. In fact it is the "*i" in the last call that causes the crash (it is always the last one ).

You could in those cases increment the iterator in the body of the loop, then you have absolute control what happens why. This is for paranoids - like me

Jan