Original Post
I just moved from VC6 to the free VC8. I have downloaded and installed the platform sdk. I believe I have configured everything correctly. I can create a sample win32 program and it runs fine. Now I am trying to recreate some of my old programs from VC6. I'm running into a problem with the vector class. The game runs fines, but if I close the game it crashes. I've narrowed the problem down to the function that cleans up all the sprites. I store the sprites in a vector. Here is the function Is there a problem with accessing the first member in a vector? The program seems to crash only when the 1st member is deleted. I am using cpp, and this program worked fine in VC6. Any ideas?
void GameEngine::CleanupSprites()
{
// Delete and remove the sprites in the sprite vector
vector<Sprite*>::iterator siSprite;
for (siSprite = m_vSprites.begin(); siSprite != m_vSprites.end(); siSprite++)
{
delete (*siSprite);
m_vSprites.erase(siSprite);
siSprite--;
}
}