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

actorid
scrawl 13 years ago
parent 420e611a4b
commit 21b8456453

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

@ -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

Loading…
Cancel
Save