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

    r3196 r3366  
    3434namespace orxonox
    3535{
    36     PawnManager* PawnManager::singletonRef_s = 0;
     36    PawnManager* PawnManager::singletonPtr_s = 0;
    3737
    3838    PawnManager::PawnManager()
    3939    {
    4040        RegisterRootObject(PawnManager);
    41 
    42         assert(PawnManager::singletonRef_s == 0);
    43         PawnManager::singletonRef_s = this;
    4441    }
    4542
    4643    PawnManager::~PawnManager()
    4744    {
    48         assert(PawnManager::singletonRef_s != 0);
    49         PawnManager::singletonRef_s = 0;
    5045    }
    5146
    5247    void PawnManager::touch()
    5348    {
    54         if (!PawnManager::singletonRef_s)
     49        if (!PawnManager::singletonPtr_s)
    5550            new PawnManager();
    5651    }
Note: See TracChangeset for help on using the changeset viewer.