[Orxonox-commit 168] r2847 - branches/gui/src/orxonox/gamestates

rgrieder at orxonox.net rgrieder at orxonox.net
Wed Mar 25 19:36:23 CET 2009


Author: rgrieder
Date: 2009-03-25 18:36:23 +0000 (Wed, 25 Mar 2009)
New Revision: 2847

Modified:
   branches/gui/src/orxonox/gamestates/GSGraphics.cc
Log:
De initialisation bugfix in GSGraphics.

Modified: branches/gui/src/orxonox/gamestates/GSGraphics.cc
===================================================================
--- branches/gui/src/orxonox/gamestates/GSGraphics.cc	2009-03-25 17:24:15 UTC (rev 2846)
+++ branches/gui/src/orxonox/gamestates/GSGraphics.cc	2009-03-25 18:36:23 UTC (rev 2847)
@@ -34,8 +34,9 @@
 
 #include "util/Debug.h"
 #include "core/ConfigValueIncludes.h"
-#include "core/CoreIncludes.h"
 #include "core/Core.h"
+#include "core/CoreIncludes.h"
+#include "core/Game.h"
 #include "core/input/InputManager.h"
 #include "core/input/KeyBinder.h"
 #include "core/input/SimpleInputState.h"
@@ -44,7 +45,6 @@
 #include "overlays/console/InGameConsole.h"
 #include "gui/GUIManager.h"
 #include "GraphicsManager.h"
-#include "core/Game.h"
 
 namespace orxonox
 {
@@ -73,10 +73,10 @@
 
     void GSGraphics::activate()
     {
-        setConfigValues();
-
         Core::setShowsGraphics(true);
 
+        setConfigValues();
+
         // initialise graphics manager. Doesn't load the render window yet!
         this->graphicsManager_ = new GraphicsManager();
         this->graphicsManager_->initialise();
@@ -112,29 +112,21 @@
 
     void GSGraphics::deactivate()
     {
-        InputManager::getInstance().requestLeaveState("master");
+        masterInputState_->setHandler(0);
+        InputManager::getInstance().requestDestroyState("master");
+        delete this->masterKeyBinder_;
 
         delete this->guiManager_;
-
         delete this->console_;
 
-        //inputManager_->getMasterInputState()->removeKeyHandler(this->masterKeyBinder_);
-        delete this->masterKeyBinder_;
-        delete this->inputManager_;
-
         Loader::unload(this->debugOverlay_);
         delete this->debugOverlay_;
 
+        delete this->inputManager_;
+        this->inputManager_ = 0;
+
         delete graphicsManager_;
 
-        masterInputState_->setHandler(0);
-        InputManager::getInstance().requestDestroyState("master");
-        if (this->masterKeyBinder_)
-        {
-            delete this->masterKeyBinder_;
-            this->masterKeyBinder_ = 0;
-        }
-
         Core::setShowsGraphics(false);
     }
 




More information about the Orxonox-commit mailing list