|
> lua_State* LB = lua_newthread(LA); You're leaving LB in LA's stack, which is limited. You're getting a stack overflow, which you can see at once if you turn on LUA_USE_APICHECK in luaconf.h. To fix the code, add lua_pop(LA,1) before returning from loadfile1.