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

    r3359 r3366  
    4545}
    4646
     47#include "util/Singleton.h"
     48
    4749// tolua_begin
    4850namespace orxonox
    4951{
    50   class _CoreExport LuaBind
     52  class _CoreExport LuaBind : public Singleton<LuaBind>
    5153  {
     54// tolua_end
     55    friend class Singleton<LuaBind>;
    5256
    53 // tolua_end
    5457    struct LoadS {
    5558      const char *s;
     
    6164      ~LuaBind();
    6265
    63       inline static LuaBind& getInstance() { assert(singletonRef_s); return *LuaBind::singletonRef_s; } // tolua_export
     66      static LuaBind& getInstance() { return Singleton<LuaBind>::getInstance(); } // tolua_export
    6467
    6568    void loadFile(const std::string& filename, bool luaTags);
     
    8992
    9093    private:
    91       static LuaBind* singletonRef_s;
     94      static LuaBind* singletonPtr_s;
    9295
    9396      std::string luaSource_;
Note: See TracChangeset for help on using the changeset viewer.