mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 19:53:48 +00:00
Ensure that getGlobalScope always returns the same object
This commit is contained in:
parent
2c9f6a5350
commit
ee93dc3b57
3 changed files with 7 additions and 7 deletions
|
|
@ -34,8 +34,6 @@ END_IMPLEMENT_CLASS;
|
|||
IMPLEMENT_NONINSTANTIABLE_CLASS( EngineExportScope,
|
||||
"A scope contained a collection of exported engine API entities." )
|
||||
END_IMPLEMENT_CLASS;
|
||||
|
||||
EngineExportScope EngineExportScope::smGlobalScope;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -142,9 +142,6 @@ class EngineExportScope : public EngineExport
|
|||
|
||||
/// Head of the link chain of exports for this scope.
|
||||
EngineExport* mExports;
|
||||
|
||||
/// The global export scope singleton.
|
||||
static EngineExportScope smGlobalScope;
|
||||
|
||||
public:
|
||||
|
||||
|
|
@ -158,7 +155,12 @@ class EngineExportScope : public EngineExport
|
|||
/// Return the global export scope singleton. This is the root of the
|
||||
/// export hierarchy and thus directly or indirectly contains all
|
||||
/// entities exported by the engine.
|
||||
static EngineExportScope* getGlobalScope() { return &smGlobalScope; }
|
||||
static EngineExportScope* getGlobalScope()
|
||||
{
|
||||
/// The global export scope singleton.
|
||||
static EngineExportScope sGlobalScope;
|
||||
return &sGlobalScope;
|
||||
}
|
||||
|
||||
/// Return the chain of exports associated with this scope.
|
||||
EngineExport* getExports() const { return mExports; }
|
||||
|
|
|
|||
|
|
@ -26,5 +26,5 @@
|
|||
const EngineTypeInfo* const _EngineTypeTraits< void >::TYPEINFO = NULL;
|
||||
EngineExportScope& _GLOBALSCOPE::__engineExportScope()
|
||||
{
|
||||
return EngineExportScope::smGlobalScope;
|
||||
return *EngineExportScope::getGlobalScope();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue