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/overlays/notifications/NotificationManager.cc

    r3196 r3366  
    4646    const std::string NotificationManager::NONE = "none";
    4747
    48     NotificationManager* NotificationManager::singletonRef_s = NULL;
     48    NotificationManager* NotificationManager::singletonPtr_s = NULL;
    4949
    5050    /**
     
    5555    {
    5656        RegisterRootObject(NotificationManager);
    57 
    58         assert(singletonRef_s == 0);
    59         singletonRef_s = this;
    6057
    6158        this->highestIndex_ = 0;
     
    7067    }
    7168
    72     /**
    73     @brief
    74         Returns the current (and single) instance of the NotificationManager. Creates one, if there isn't one to begin with.
    75     @return
    76         Returns a reference to the single instance of the NotificationManager.
    77     */
    78     /*static*/ NotificationManager & NotificationManager::getInstance()
    79     {
    80         assert(singletonRef_s);
    81         return *singletonRef_s;
    82     }
    83    
    8469    /**
    8570    @brief
Note: See TracChangeset for help on using the changeset viewer.