Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2847 for code/branches


Ignore:
Timestamp:
Mar 25, 2009, 7:36:23 PM (16 years ago)
Author:
rgrieder
Message:

De initialisation bugfix in GSGraphics.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gui/src/orxonox/gamestates/GSGraphics.cc

    r2846 r2847  
    3535#include "util/Debug.h"
    3636#include "core/ConfigValueIncludes.h"
     37#include "core/Core.h"
    3738#include "core/CoreIncludes.h"
    38 #include "core/Core.h"
     39#include "core/Game.h"
    3940#include "core/input/InputManager.h"
    4041#include "core/input/KeyBinder.h"
     
    4546#include "gui/GUIManager.h"
    4647#include "GraphicsManager.h"
    47 #include "core/Game.h"
    4848
    4949namespace orxonox
     
    7474    void GSGraphics::activate()
    7575    {
     76        Core::setShowsGraphics(true);
     77
    7678        setConfigValues();
    77 
    78         Core::setShowsGraphics(true);
    7979
    8080        // initialise graphics manager. Doesn't load the render window yet!
     
    113113    void GSGraphics::deactivate()
    114114    {
    115         InputManager::getInstance().requestLeaveState("master");
     115        masterInputState_->setHandler(0);
     116        InputManager::getInstance().requestDestroyState("master");
     117        delete this->masterKeyBinder_;
    116118
    117119        delete this->guiManager_;
    118 
    119120        delete this->console_;
    120 
    121         //inputManager_->getMasterInputState()->removeKeyHandler(this->masterKeyBinder_);
    122         delete this->masterKeyBinder_;
    123         delete this->inputManager_;
    124121
    125122        Loader::unload(this->debugOverlay_);
    126123        delete this->debugOverlay_;
    127124
     125        delete this->inputManager_;
     126        this->inputManager_ = 0;
     127
    128128        delete graphicsManager_;
    129 
    130         masterInputState_->setHandler(0);
    131         InputManager::getInstance().requestDestroyState("master");
    132         if (this->masterKeyBinder_)
    133         {
    134             delete this->masterKeyBinder_;
    135             this->masterKeyBinder_ = 0;
    136         }
    137129
    138130        Core::setShowsGraphics(false);
Note: See TracChangeset for help on using the changeset viewer.