When reloading elements API, set packages.loaded["elements"] to nil to prevent luaL_register from trying to reuse a nilled table. Fixes #189
This commit is contained in:
parent
8a4d18df49
commit
42ec654f3e
@ -725,6 +725,14 @@ int LuaScriptInterface::elements_loadDefault(lua_State * l)
|
||||
}
|
||||
lua_pushnil(l);
|
||||
lua_setglobal(l, "elements");
|
||||
lua_pushnil(l);
|
||||
lua_setglobal(l, "elem");
|
||||
|
||||
lua_getglobal(l, "package");
|
||||
lua_getfield(l, -1, "loaded");
|
||||
lua_pushnil(l);
|
||||
lua_setfield(l, -2, "elements");
|
||||
|
||||
luacon_ci->initElementsAPI();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user