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/orxonox/objects/quest/QuestManager.cc

    r3349 r3366  
    4747{
    4848    //! Pointer to the current (and single) instance of this class.
    49     /*static*/ QuestManager* QuestManager::singletonRef_s = NULL;
     49    /*static*/ QuestManager* QuestManager::singletonPtr_s = NULL;
    5050
    5151    /**
     
    5858    {
    5959        RegisterRootObject(QuestManager);
    60 
    61         assert(singletonRef_s == 0);
    62         singletonRef_s = this;
    6360    }
    6461
     
    7067    {
    7168
    72     }
    73 
    74     /**
    75     @brief
    76         Returns a reference to the current (and single) instance of the QuestManager, and creates one if there isn't one to begin with.
    77     @return
    78         Returns a reference to the single instance of the Quest Manager.
    79     */
    80     /*static*/ QuestManager & QuestManager::getInstance()
    81     {
    82         assert(singletonRef_s);
    83         return *singletonRef_s;
    8469    }
    8570
Note: See TracChangeset for help on using the changeset viewer.