MINOR: lua: reset pointer after use

After releasing the Lua environment, this patch set the only one pointer to
the Lua stack to NULL. This prevents an accidental re-use.
This commit is contained in:
Thierry FOURNIER 2015-09-21 22:50:24 +02:00 committed by Willy Tarreau
parent fd50f0bcc8
commit a7b536b53b

View File

@ -907,6 +907,7 @@ void hlua_ctx_destroy(struct hlua *lua)
/* The thread is garbage collected by Lua. */ /* The thread is garbage collected by Lua. */
luaL_unref(lua->T, LUA_REGISTRYINDEX, lua->Mref); luaL_unref(lua->T, LUA_REGISTRYINDEX, lua->Mref);
luaL_unref(gL.T, LUA_REGISTRYINDEX, lua->Tref); luaL_unref(gL.T, LUA_REGISTRYINDEX, lua->Tref);
lua->T = NULL;
} }
/* This function is used to restore the Lua context when a coroutine /* This function is used to restore the Lua context when a coroutine