int j = 0;
for(vector<face*>::iterator i = faces.begin();
i != faces.end();
i++, j++)
{
cout << "deleting " << j << " face\n";
delete (*(i._Myptr));
}
When I run this loop, the first iteration of this loop runs fine, but the second time around, the program crashes. When I run the debugger, it says "Unhandled exception at 0x104817fd in OBJLoader.exe: 0xC0000005: Access violation writing location 0xfeeefeee."
And it points to this line with the arrow in the vector library.
#if _HAS_ITERATOR_DEBUGGING
this->_Orphan_all();//<----------- This line here
#endif /* _HAS_ITERATOR_DEBUGGING */
_Destroy(_Myfirst, _Mylast);
this->_Alval.deallocate(_Myfirst, _Myend - _Myfirst);
}
_Myfirst = 0, _Mylast = 0, _Myend = 0;
}
Does anyone have any idea what's going on here?