1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 00:35:23 +00:00

fixed a double-free that can happen if OpenMW exits prematurely (when OgreRenderer is deleted before CreateScene() was called)

This commit is contained in:
scrawl 2012-02-20 21:09:08 +01:00
parent 420e611a4b
commit 21b8456453
2 changed files with 3 additions and 2 deletions

View File

@ -13,7 +13,8 @@ using namespace OEngine::Render;
void OgreRenderer::cleanup()
{
delete mFader;
if (mFader)
delete mFader;
if(mRoot)
delete mRoot;

View File

@ -32,7 +32,7 @@ namespace Render
public:
OgreRenderer()
: mRoot(NULL), mWindow(NULL), mScene(NULL) {}
: mRoot(NULL), mWindow(NULL), mScene(NULL), mFader(NULL) {}
~OgreRenderer() { cleanup(); }
/** Configure the renderer. This will load configuration files and