mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 18:19:55 +00:00
Change destruction order - fixes a shutdown crash discovered with mesa
This commit is contained in:
parent
def93f9910
commit
a3ff9e5be8
3 changed files with 18 additions and 6 deletions
|
@ -42,10 +42,10 @@ int main(int argc, char *argv[])
|
|||
|
||||
// TODO: Ogre startup shouldn't be here, but it currently has to:
|
||||
// SceneWidget destructor will delete the created render window, which would be called _after_ Root has shut down :(
|
||||
OgreInit::OgreInit ogreInit;
|
||||
ogreInit.init("./opencsOgre.log"); // TODO log path?
|
||||
|
||||
Application mApplication (argc, argv);
|
||||
OgreInit::OgreInit ogreInit;
|
||||
ogreInit.init("./opencsOgre.log"); // TODO log path?
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
QDir dir(QCoreApplication::applicationDirPath());
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
#include <extern/sdl4ogre/sdlwindowhelper.hpp>
|
||||
|
||||
#include <components/ogreinit/ogreinit.hpp>
|
||||
|
||||
#include <cassert>
|
||||
#include <stdexcept>
|
||||
|
||||
|
@ -23,6 +25,12 @@ void OgreRenderer::cleanup()
|
|||
delete mFader;
|
||||
mFader = NULL;
|
||||
|
||||
Ogre::Root::getSingleton().destroyRenderTarget(mWindow);
|
||||
mWindow = NULL;
|
||||
|
||||
delete mOgreInit;
|
||||
mOgreInit = NULL;
|
||||
|
||||
// If we don't do this, the desktop resolution is not restored on exit
|
||||
SDL_SetWindowFullscreen(mSDLWindow, 0);
|
||||
|
||||
|
@ -50,7 +58,8 @@ void OgreRenderer::configure(const std::string &logPath,
|
|||
const std::string& rttMode
|
||||
)
|
||||
{
|
||||
mRoot = mOgreInit.init(logPath + "/ogre.log");
|
||||
mOgreInit = new OgreInit::OgreInit();
|
||||
mRoot = mOgreInit->init(logPath + "/ogre.log");
|
||||
|
||||
RenderSystem* rs = mRoot->getRenderSystemByName(renderSystem);
|
||||
if (rs == 0)
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
|
||||
#include <OgreTexture.h>
|
||||
|
||||
#include <components/ogreinit/ogreinit.hpp>
|
||||
|
||||
|
||||
struct SDL_Window;
|
||||
struct SDL_Surface;
|
||||
|
@ -26,6 +24,11 @@ namespace Ogre
|
|||
class ParticleAffectorFactory;
|
||||
}
|
||||
|
||||
namespace OgreInit
|
||||
{
|
||||
class OgreInit;
|
||||
}
|
||||
|
||||
namespace OEngine
|
||||
{
|
||||
namespace Render
|
||||
|
@ -57,7 +60,7 @@ namespace OEngine
|
|||
Ogre::Camera *mCamera;
|
||||
Ogre::Viewport *mView;
|
||||
|
||||
OgreInit::OgreInit mOgreInit;
|
||||
OgreInit::OgreInit* mOgreInit;
|
||||
|
||||
Fader* mFader;
|
||||
|
||||
|
|
Loading…
Reference in a new issue