luajit: cleanup states before return to pool

pull/2757/head
Victor Julien 8 years ago
parent 994a2fdb84
commit 4a0e4cbbfb

@ -647,8 +647,6 @@ static int LuaScriptInit(const char *filename, LogLuaScriptOptions *options) {
goto error;
}
/* pop the table */
lua_pop(luastate, 1);
LuaReturnState(luastate);
return 0;
error:

@ -70,6 +70,10 @@ lua_State *LuaGetState(void)
void LuaReturnState(lua_State *s)
{
if (s != NULL) {
/* clear the stack */
while (lua_gettop(s) > 0) {
lua_pop(s, 1);
}
#ifdef HAVE_LUAJIT
LuajitReturnState(s);
#else

Loading…
Cancel
Save