Tuesday, October 26, 2010

Problem solved once again....Somehow

I figured out the error really quick.
The problem was that when the last object got erased from the list via

i = Timers.erase(i);

the iterator pointed to the space equals to Timers.end().
The for loop then incremented the iterator and voila you get an pointer to undefined memory.

I don't know why the for loop didn't jumped out at this point even though
the stop condition for the loop is

i != Timers.end()


After I added the following line at the end of the for loop, the error disappeared.

if(i == Timers.end())
break;

No comments:

Post a Comment