1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 18:19:55 +00:00

Delete Ogre::OverlaySystem before Ogre::Root

This commit is contained in:
cc9cii 2014-10-15 07:02:19 +11:00
parent 8cebfc411b
commit 1d0ac3b4df
3 changed files with 13 additions and 1 deletions

View file

@ -18,6 +18,7 @@
#include "model/doc/document.hpp" #include "model/doc/document.hpp"
#include "model/world/data.hpp" #include "model/world/data.hpp"
#include "view/render/overlaysystem.hpp"
CS::Editor::Editor (OgreInit::OgreInit& ogreInit) CS::Editor::Editor (OgreInit::OgreInit& ogreInit)
: mUserSettings (mCfgMgr), mDocumentManager (mCfgMgr), mViewManager (mDocumentManager), : mUserSettings (mCfgMgr), mDocumentManager (mCfgMgr), mViewManager (mDocumentManager),
@ -65,6 +66,11 @@ CS::Editor::Editor (OgreInit::OgreInit& ogreInit)
this, SLOT (createNewGame (const boost::filesystem::path&))); 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) void CS::Editor::setupDataFiles (const Files::PathContainer& dataDirs)
{ {
for (Files::PathContainer::const_iterator iter = dataDirs.begin(); iter != dataDirs.end(); ++iter) for (Files::PathContainer::const_iterator iter = dataDirs.begin(); iter != dataDirs.end(); ++iter)

View file

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

View file

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