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

    r3346 r3366  
    4545
    4646#include "util/OgreForwardRefs.h"
     47#include "util/Singleton.h"
    4748#include "input/InputHandler.h"
    4849
     
    6061        Those input events are then injected into CEGUI in Lua.
    6162    */
    62     class _CoreExport GUIManager : public InputHandler
     63    class _CoreExport GUIManager : public Singleton<GUIManager>, public InputHandler
    6364    {
     65        friend class Singleton<GUIManager>;
    6466    public:
    6567        GUIManager(Ogre::RenderWindow* renderWindow);
     
    7375        void setCamera(Ogre::Camera* camera);
    7476
    75         static GUIManager& getInstance()    { assert(singletonRef_s); return *singletonRef_s; }
    76         static GUIManager* getInstancePtr() { return singletonRef_s; }
     77        static GUIManager* getInstancePtr() { return singletonPtr_s; }
    7778
    7879    private:
     
    99100        lua_State*               luaState_;         //!< Lua state, access point to the Lua engine
    100101
    101         static GUIManager*       singletonRef_s;    //!< Singleton reference to GUIManager
     102        static GUIManager*       singletonPtr_s;    //!< Singleton reference to GUIManager
    102103
    103104    };
Note: See TracChangeset for help on using the changeset viewer.