Change the way the lua engine initialization functions are called
This commit is contained in:
@@ -434,6 +434,7 @@ eng::string SourceDB::rebuild_module(const eng::string &mod) {
|
||||
}
|
||||
|
||||
void SourceDB::init(lua_State *L) {
|
||||
register_lua_builtins();
|
||||
lua_state_ = L;
|
||||
LuaVar globtab, persist, unpersist, classname, classtab, funcname, funcp, rawfunc, nullstring;
|
||||
LuaExtStack LS(L, globtab, persist, unpersist, classname, classtab, funcname, funcp, rawfunc, nullstring);
|
||||
@@ -508,6 +509,10 @@ void SourceDB::deserialize_source(util::LuaSourceVec *sv, StreamBuffer *sb) {
|
||||
// print out an error.
|
||||
//
|
||||
void SourceDB::register_lua_builtins() {
|
||||
static bool initialized = false;
|
||||
if (initialized) return;
|
||||
initialized = true;
|
||||
|
||||
lua_State *L = LuaCoreStack::newstate(nullptr);
|
||||
luaL_openlibs(L);
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user