Error in nxOgre::world::destroyScene

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;
}

betajaen

09-09-2006 16:34:45

Thanks.

I found this out a few days ago with a similar situation, and I came up with the exact same code. I had to double take there and check the CVS. Your fix is the same as my fix ;)

rUmbl3

09-09-2006 16:37:04

I am glad to hear that :) hope you get a new version with this fix up in the next days/weeks.

betajaen

09-09-2006 16:38:55

I'm wanting for the sake of my sanity for NxOgre 0.4 to be released next week or so, both in installer and source forms, then comes the big 0.5 with *everything* completed.

rUmbl3

09-09-2006 16:48:26

That's great news!

Only one more thing: Could you replace all std::cout's with Ogre::LogManager? would make it much easier for me :) (for debugging purposes i am disabling all console output from the default log and all non-debug logs)
most of them seem just as some debugging thingies of you :) so it would get removed anyway ...

betajaen

09-09-2006 17:36:40

How about the new Error class with NxOgre?

error::getSingleton().Throw("Argh, the car is on fire", error::warning);

or:

error::getSingleton().Note("Pick up some bread and milk");