Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 9, 2011, 5:06:49 AM (13 years ago)
Author:
rgrieder
Message:

Added and incorporated new class DestructionHelper: instead of doing the destruction of certain singletons implicitly via scoped_ptrs and ScopeGuards, use a method named destroy() that essentially achieves the same, but makes the destruction sequence obvious.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/core/GUIManager.h

    r8411 r8423  
    4444#include <CEGUIVersion.h>
    4545#include <boost/shared_ptr.hpp>
    46 #include <loki/ScopeGuard.h>
    4746
     47#include "util/DestructionHelper.h"
    4848#include "util/OgreForwardRefs.h"
    4949#include "util/TriBool.h"
     
    8383    public:
    8484        GUIManager(const std::pair<int, int>& mousePosition);
     85
    8586        //! Leave empty and use cleanup() instead
    8687        ~GUIManager() {}
     88        /// Destructor that also executes when object fails to construct
     89        void destroy();
    8790
    8891        void setConfigValues(void);
     
    134137        GUIManager(const GUIManager& instance); //!< private and undefined copy c'tor (this is a singleton class)
    135138
    136         /// Destructor that also executes when object fails to construct
    137         void cleanup();
    138 
    139139        void executeCode(const std::string& str);
    140140
     
    156156        virtual void windowResized(unsigned int newWidth, unsigned int newHeight);
    157157        virtual void windowFocusChanged(bool bFocus);
    158 
    159         /// Surrogate for the destructor
    160         Loki::ObjScopeGuardImpl0<GUIManager, void (GUIManager::*)()> destroyer_;
    161158
    162159#ifdef ORXONOX_OLD_CEGUI
     
    180177        Ogre::Camera*                        camera_;           //!< Camera used to render the scene with the GUI
    181178
     179        /// Helper object that executes the surrogate destructor destroy()
     180        DestructionHelper<GUIManager>        destructionHelper_;
     181
    182182        static GUIManager*                   singletonPtr_s;    //!< Singleton reference to GUIManager
    183183
Note: See TracChangeset for help on using the changeset viewer.