Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 4, 2009, 12:02:28 AM (15 years ago)
Author:
rgrieder
Message:

Modified Scoped Singleton concept: Derive from Singleton normally, but place an important pre-main() instruction in the source file: ManageScopedSingleton(className, scope) (it's a macro).
This causes the Singleton to be created and destroyed with the Scope. Thus if a Singleton c'tor throws, it is much easier to react accordingly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/src/orxonox/overlays/InGameConsole.cc

    r5855 r5867  
    4848#include "core/ConfigValueIncludes.h"
    4949#include "core/ConsoleCommand.h"
     50#include "core/ScopedSingletonManager.h"
    5051#include "core/input/InputManager.h"
    5152#include "core/input/InputState.h"
     
    6162
    6263    InGameConsole* InGameConsole::singletonPtr_s = 0;
     64    ManageScopedSingleton(InGameConsole, ScopeID::Graphics);
    6365
    6466    /**
Note: See TracChangeset for help on using the changeset viewer.