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

    r3280 r3366  
    8989    // ###############################
    9090
    91     Language* Language::singletonRef_s = 0;
     91    Language* Language::singletonPtr_s = 0;
    9292
    9393    /**
     
    9696    Language::Language()
    9797    {
    98         assert(singletonRef_s == 0);
    99         singletonRef_s = this;
    100 
    10198        this->defaultLanguage_ = "default";
    10299        this->defaultLocalisation_ = "ERROR: LANGUAGE ENTRY DOESN'T EXIST!";
     
    113110        for (std::map<std::string, LanguageEntry*>::iterator it = this->languageEntries_.begin(); it != this->languageEntries_.end(); ++it)
    114111            delete (it->second);
    115 
    116         assert(singletonRef_s);
    117         singletonRef_s = 0;
    118112    }
    119113
Note: See TracChangeset for help on using the changeset viewer.