Delete Ogre::OverlaySystem before Ogre::Root

loadfix
cc9cii 10 years ago
parent 8cebfc411b
commit 1d0ac3b4df

@ -18,6 +18,7 @@
#include "model/doc/document.hpp"
#include "model/world/data.hpp"
#include "view/render/overlaysystem.hpp"
CS::Editor::Editor (OgreInit::OgreInit& ogreInit)
: mUserSettings (mCfgMgr), mDocumentManager (mCfgMgr), mViewManager (mDocumentManager),
@ -65,6 +66,11 @@ CS::Editor::Editor (OgreInit::OgreInit& ogreInit)
this, SLOT (createNewGame (const boost::filesystem::path&)));
}
CS::Editor::~Editor ()
{
CSVRender::OverlaySystem::instance().destroy(); // destruct before Ogre::Root
}
void CS::Editor::setupDataFiles (const Files::PathContainer& dataDirs)
{
for (Files::PathContainer::const_iterator iter = dataDirs.begin(); iter != dataDirs.end(); ++iter)

@ -64,6 +64,7 @@ namespace CS
public:
Editor (OgreInit::OgreInit& ogreInit);
~Editor ();
bool makeIPCServer();
void connectToIPCServer();

@ -14,7 +14,7 @@ namespace CSVRender
}
~OverlaySystem() {
delete mOverlaySystem;
if(mOverlaySystem) delete mOverlaySystem;
}
OverlaySystem(OverlaySystem const&);
@ -30,6 +30,11 @@ namespace CSVRender
Ogre::OverlaySystem *get() {
return mOverlaySystem;
}
void destroy() {
delete mOverlaySystem;
mOverlaySystem = NULL;
}
};
}

Loading…
Cancel
Save