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/ConfigFileManager.cc

    r3301 r3366  
    4242    const char* const DEFAULT_CONFIG_FILE = "default.ini";
    4343
    44     ConfigFileManager* ConfigFileManager::singletonRef_s = 0;
     44    ConfigFileManager* ConfigFileManager::singletonPtr_s = 0;
    4545
    4646    SetConsoleCommandShortcutExtern(config).argumentCompleter(0, autocompletion::configvalueclasses()).argumentCompleter(1, autocompletion::configvalues()).argumentCompleter(2, autocompletion::configvalue());
     
    482482         : mininmalFreeType_(ConfigFileType::numberOfReservedTypes)
    483483    {
    484         assert(singletonRef_s == 0);
    485         singletonRef_s = this;
    486484    }
    487485
     
    490488        for(std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); )
    491489            delete (it++)->second;
    492 
    493         assert(singletonRef_s != 0);
    494         singletonRef_s = 0;
    495490    }
    496491
Note: See TracChangeset for help on using the changeset viewer.