tolerate Register being called before THEME is initialized (like we do
with other singletons)
This commit is contained in:
@@ -882,11 +882,15 @@ public:
|
|||||||
ADD_METHOD( GetPath )
|
ADD_METHOD( GetPath )
|
||||||
Luna<T>::Register( L );
|
Luna<T>::Register( L );
|
||||||
|
|
||||||
// add global singleton
|
// Add global singleton if constructed already. If it's not constructed yet,
|
||||||
ASSERT( THEME );
|
// then we'll register it later when we reinit Lua just before
|
||||||
lua_pushstring(L, "THEME");
|
// initializing the display.
|
||||||
THEME->PushSelf( LUA->L );
|
if( THEME )
|
||||||
lua_settable(L, LUA_GLOBALSINDEX);
|
{
|
||||||
|
lua_pushstring(L, "THEME");
|
||||||
|
THEME->PushSelf( LUA->L );
|
||||||
|
lua_settable(L, LUA_GLOBALSINDEX);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user