shutdown crash fix

actorid
scrawl 13 years ago
parent ff84fbbfa7
commit 447158e9d6

@ -112,6 +112,8 @@ RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const
RenderingManager::~RenderingManager () RenderingManager::~RenderingManager ()
{ {
mRendering.removeWindowEventListener(this);
delete mPlayer; delete mPlayer;
delete mSkyManager; delete mSkyManager;
delete mDebugging; delete mDebugging;

@ -114,6 +114,9 @@ Water::~Water()
{ {
MeshManager::getSingleton().remove("water"); MeshManager::getSingleton().remove("water");
if (mReflectionTarget)
mReflectionTexture->getBuffer()->getRenderTarget()->removeListener(this);
mWaterNode->detachObject(mWater); mWaterNode->detachObject(mWater);
mSceneManager->destroyEntity(mWater); mSceneManager->destroyEntity(mWater);
mSceneManager->destroySceneNode(mWaterNode); mSceneManager->destroySceneNode(mWaterNode);

@ -156,6 +156,11 @@ void OgreRenderer::setWindowEventListener(Ogre::WindowEventListener* listener)
Ogre::WindowEventUtilities::addWindowEventListener(mWindow, listener); Ogre::WindowEventUtilities::addWindowEventListener(mWindow, listener);
} }
void OgreRenderer::removeWindowEventListener(Ogre::WindowEventListener* listener)
{
Ogre::WindowEventUtilities::removeWindowEventListener(mWindow, listener);
}
void OgreRenderer::setFov(float fov) void OgreRenderer::setFov(float fov)
{ {
mCamera->setFOVy(Degree(fov)); mCamera->setFOVy(Degree(fov));

@ -106,6 +106,7 @@ namespace OEngine
~OgreRenderer() { cleanup(); } ~OgreRenderer() { cleanup(); }
void setWindowEventListener(Ogre::WindowEventListener* listener); void setWindowEventListener(Ogre::WindowEventListener* listener);
void removeWindowEventListener(Ogre::WindowEventListener* listener);
/** Configure the renderer. This will load configuration files and /** Configure the renderer. This will load configuration files and
set up the Root and logging classes. */ set up the Root and logging classes. */

Loading…
Cancel
Save