Pottej
21-06-2007 17:07:27
Hi,
In our game we needed to completely shut down the nxogre world and reinitialise it, but found out that we got errors when trying to do this.
To shut down we used:
Then later I remake:
Which throws an exception at runtime. I found that the exception came because although the NxOgre::Error class is shut down, the singleton pointer is never deleted. Therefore to make a new world we added the line:
in Error::~Error(), so when the class is shut down the singleton pointer is reset to 0 too. This has fixed all our problems and we can now delete and remake physics worlds without errors.
I just thought I better post this here in case it is causing anyone else problems.
Pottej
In our game we needed to completely shut down the nxogre world and reinitialise it, but found out that we got errors when trying to do this.
To shut down we used:
mScene->destroyCharacter("whatever"); // not my actual character destruction
delete mScene;
delete mWorld;
Then later I remake:
mWorld = new NxOgre::World("FrameListener: No");
Which throws an exception at runtime. I found that the exception came because although the NxOgre::Error class is shut down, the singleton pointer is never deleted. Therefore to make a new world we added the line:
mError = 0;
in Error::~Error(), so when the class is shut down the singleton pointer is reset to 0 too. This has fixed all our problems and we can now delete and remake physics worlds without errors.
I just thought I better post this here in case it is causing anyone else problems.
Pottej