Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 29, 2009, 10:27:10 PM (15 years ago)
Author:
rgrieder
Message:

Derived all singletons implemented in a usual manner from orxonox::Singleton<T>.
This resolves inconsistencies with the singletonPtr_s variable in case of exceptions (asserts were being triggered then).
And while at it replaced singletonRef_s with singletonPtr_s for it to be less misleading (as fabian has already pointed out).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/resource/src/core/Game.cc

    r3363 r3366  
    6262
    6363    std::map<std::string, GameStateInfo> Game::gameStateDeclarations_s;
    64     Game* Game::singletonRef_s = 0;
     64    Game* Game::singletonPtr_s = 0;
    6565
    6666
     
    114114    Game::Game(const std::string& cmdLine)
    115115    {
    116         if (singletonRef_s != 0)
    117         {
    118             COUT(0) << "Error: The Game singleton cannot be recreated! Shutting down." << std::endl;
    119             abort();
    120         }
    121         singletonRef_s = this;
    122 
    123116        this->bAbort_ = false;
    124117        bChangingState_ = false;
     
    163156    Game::~Game()
    164157    {
    165         // Don't assign singletonRef_s with NULL! Recreation is not supported
    166158    }
    167159
Note: See TracChangeset for help on using the changeset viewer.