Index: /code/branches/core7/src/libraries/core/Core.cc
===================================================================
--- /code/branches/core7/src/libraries/core/Core.cc	(revision 10523)
+++ /code/branches/core7/src/libraries/core/Core.cc	(revision 10524)
@@ -309,5 +309,5 @@
 
         // Any exception should trigger this, even in upgradeToGraphics (see its remarks)
-        Loki::ScopeGuard unloader = Loki::MakeObjGuard(*this, &Core::unloadGraphics);
+        Loki::ScopeGuard unloader = Loki::MakeObjGuard(*this, &Core::unloadGraphics, true);
 
         // Upgrade OGRE to receive a render window
@@ -357,5 +357,5 @@
     }
 
-    void Core::unloadGraphics()
+    void Core::unloadGraphics(bool loadGraphicsManagerWithoutRenderer)
     {
         orxout(internal_info) << "unloading graphics in Core" << endl;
@@ -368,5 +368,8 @@
         // Load Ogre::Root again, but without the render system
         try
-            { this->graphicsManager_ = new GraphicsManager(false); }
+        {
+            if (loadGraphicsManagerWithoutRenderer)
+                this->graphicsManager_ = new GraphicsManager(false);
+        }
         catch (...)
         {
Index: /code/branches/core7/src/libraries/core/Core.h
===================================================================
--- /code/branches/core7/src/libraries/core/Core.h	(revision 10523)
+++ /code/branches/core7/src/libraries/core/Core.h	(revision 10524)
@@ -80,5 +80,5 @@
 
             void loadGraphics();
-            void unloadGraphics();
+            void unloadGraphics(bool loadGraphicsManagerWithoutRenderer = true);
 
             void loadModules();
Index: /code/branches/core7/src/libraries/core/Game.cc
===================================================================
--- /code/branches/core7/src/libraries/core/Game.cc	(revision 10523)
+++ /code/branches/core7/src/libraries/core/Game.cc	(revision 10524)
@@ -518,5 +518,5 @@
 
             core_->loadGraphics();
-            Loki::ScopeGuard graphicsUnloader = Loki::MakeObjGuard(*this, &Game::unloadGraphics);
+            Loki::ScopeGuard graphicsUnloader = Loki::MakeObjGuard(*this, &Game::unloadGraphics, true);
 
             // Construct all the GameStates that require graphics
@@ -539,5 +539,5 @@
     }
 
-    void Game::unloadGraphics()
+    void Game::unloadGraphics(bool loadGraphicsManagerWithoutRenderer)
     {
         if (GameMode::showsGraphics())
@@ -555,5 +555,5 @@
             }
 
-            core_->unloadGraphics();
+            core_->unloadGraphics(loadGraphicsManagerWithoutRenderer);
         }
     }
@@ -576,5 +576,5 @@
 
         // If state requires graphics, load it
-        Loki::ScopeGuard graphicsUnloader = Loki::MakeObjGuard(*this, &Game::unloadGraphics);
+        Loki::ScopeGuard graphicsUnloader = Loki::MakeObjGuard(*this, &Game::unloadGraphics, true);
         if (gameStateDeclarations_s[name].bGraphicsMode && !GameMode::showsGraphics())
             this->loadGraphics();
@@ -612,12 +612,9 @@
         }
         // Check if graphics is still required
-        if (!bAbort_)
-        {
-            bool graphicsRequired = false;
-            for (unsigned i = 0; i < loadedStates_.size(); ++i)
-                graphicsRequired |= loadedStates_[i]->getInfo().bGraphicsMode;
-            if (!graphicsRequired)
-                this->unloadGraphics();
-        }
+        bool graphicsRequired = false;
+        for (unsigned i = 0; i < loadedStates_.size(); ++i)
+            graphicsRequired |= loadedStates_[i]->getInfo().bGraphicsMode;
+        if (!graphicsRequired)
+            this->unloadGraphics(!this->bAbort_); // if abort is false, that means the game is still running while unloading graphics. in this case we load a graphics manager without renderer (to keep all necessary ogre instances alive)
         this->bChangingState_ = false;
     }
Index: /code/branches/core7/src/libraries/core/Game.h
===================================================================
--- /code/branches/core7/src/libraries/core/Game.h	(revision 10523)
+++ /code/branches/core7/src/libraries/core/Game.h	(revision 10524)
@@ -148,5 +148,5 @@
 
         void loadGraphics();
-        void unloadGraphics();
+        void unloadGraphics(bool loadGraphicsManagerWithoutRenderer = true);
 
         void parseStates(std::vector<std::pair<std::string, int> >::const_iterator& it, shared_ptr<GameStateTreeNode> currentNode);
