diff --git a/src/hlua.c b/src/hlua.c index 85e0c664e..408a9f266 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -857,6 +857,7 @@ int hlua_ctx_init(struct hlua *lua, struct task *task) lua->T = lua_newthread(gL.T); if (!lua->T) { lua->Tref = LUA_REFNIL; + RESET_SAFE_LJMP(gL.T); return 0; } hlua_sethlua(lua);