I want to exit my scene and go back to my 2d main menu...
I tried using sceneManager->clear() to clear the mesh that was loaded in and that seems fine. Until i exit my program from the 2d menu at which point i get a crash while deleting the device.
Have no way of adding image so i have written stack
Added some of the stack, top part of the stack is....
virtual ~SHWBufferLink()
{
if (MeshBuffer)
MeshBuffer->drop();
}
.
.
.
void CNullDriver::deleteHardwareBuffer(SHWBufferLink *HWBuffer)
{
if (!HWBuffer)
return;
HWBufferMap.remove(HWBuffer->MeshBuffer);
delete HWBuffer;
}
..
..
..
..
SceneManager::~SceneManager
{
.
.
.
if (Driver)
Driver->removeAllHardwareBuffers ();
}
Clear a scene?
If you have any existing textures you may need to clear them? But for claritys sake you are saying that you load the scene, then when you quit back to the 2d menu and try to exit it crashes on exit? Does it do this without the sceneManager->clear()? Could it be a problem elsewhere in the code? Such as the recreation of the menu GUI? Perhaps it would also help to link some more code?
But the cage only had "Warning: Vicious Lions" on it! Im a programmer! I only listen to errors!
Yes, exactlyBut for claritys sake you are saying that you load the scene, then when you quit back to the 2d menu and try to exit it crashes on exit?
No, have tried it without, no crash.Does it do this without the sceneManager->clear()?
Menu gui is only created once, at startup. I did not clear the guiEnvironment so i don't think this could be it. Although i do load one texture during the intro. It stays loaded until program exits. As in i don't have any other code anywhere that does anything else to the texture.Could it be a problem elsewhere in the code? Such as the recreation of the menu GUI?
Code: Select all
m_pImage->setImage( g_pApp->GetVideoDriver()->getTexture("media/logo2.png") );
I think i fixed it, well the crash doesn't happen anymore...
I changed this...
to this...
I changed this...
Code: Select all
g_pApp->GetSceneManager()->clear();
Code: Select all
g_pApp->GetVideoDriver()->removeAllHardwareBuffers();
g_pApp->GetVideoDriver()->removeAllTextures();
g_pApp->GetSceneManager()->clear();