rUmbl3
09-09-2006 16:25:15
I always got a stupid exception when ending my program. In the destructor of my Engine class I first deleted the map in which I created and destroyed the scene. After that i deleted the nxOgre world. That always leaded to a crash. After some code review I found the error for that. The world destructor always thought that there was still a scene. If you change the code to the following it will work as suspected.
bool world::destroyScene(Ogre::String _name)
{
if (mScene.size() > 0) {
for(std::vector< nxOgre::scene* >::iterator i = mScene.begin();i != mScene.end();++i) {
if ((*i)->getName() == _name) {
delete (*i);
mScene.erase(i);
return true;
}
}
}
return false;
}