I\'ve got code that looks like this:
for (std::list::iterator i=items.begin();i!=items.end();i++) { bool isActive = (*i)->update(); /
You want to do:
i= items.erase(i);
That will correctly update the iterator to point to the location after the iterator you removed.