From c6558fe487b6c53d6be6a470de9061bb11fc0082 Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 19 Nov 2014 13:19:02 +0100 Subject: [PATCH] Fix Ogre being initialised twice --- apps/launcher/graphicspage.cpp | 3 ++- components/ogreinit/ogreinit.cpp | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp index 1c6e69023..ec7f5a04d 100644 --- a/apps/launcher/graphicspage.cpp +++ b/apps/launcher/graphicspage.cpp @@ -137,6 +137,7 @@ bool Launcher::GraphicsPage::setupSDL() return false; } + screenComboBox->clear(); for (int i = 0; i < displays; i++) { screenComboBox->addItem(QString(tr("Screen ")) + QString::number(i + 1)); @@ -149,7 +150,7 @@ bool Launcher::GraphicsPage::loadSettings() { if (!setupSDL()) return false; - if (!setupOgre()) + if (!mOgre && !setupOgre()) return false; if (mGraphicsSettings.value(QString("Video/vsync")) == QLatin1String("true")) diff --git a/components/ogreinit/ogreinit.cpp b/components/ogreinit/ogreinit.cpp index 40712e282..574b67f19 100644 --- a/components/ogreinit/ogreinit.cpp +++ b/components/ogreinit/ogreinit.cpp @@ -94,6 +94,8 @@ namespace OgreInit Ogre::Root* OgreInit::init(const std::string &logPath) { + if (mRoot) + throw std::runtime_error("OgreInit was already initialised"); #ifndef ANDROID // Set up logging first