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/TclBind.h

    r3360 r3366  
    3434#include <cassert>
    3535#include <string>
     36#include "util/Singleton.h"
    3637
    3738namespace orxonox
    3839{
    39     class _CoreExport TclBind
     40    class _CoreExport TclBind : public Singleton<TclBind>
    4041    {
     42        friend class Singleton<TclBind>;
    4143        public:
    4244            TclBind(const std::string& datapath);
    4345            ~TclBind();
    44 
    45             static TclBind& getInstance() { assert(singletonRef_s); return *singletonRef_s; }
    4646
    4747            static std::string tcl(const std::string& tclcode);
     
    6868            bool bSetTclDataPath_;
    6969
    70             static TclBind* singletonRef_s;
     70            static TclBind* singletonPtr_s;
    7171    };
    7272}
Note: See TracChangeset for help on using the changeset viewer.