From a7b536b53bfd4bf5f9c8cf748411c85abdc7f92a Mon Sep 17 00:00:00 2001 From: Thierry FOURNIER Date: Mon, 21 Sep 2015 22:50:24 +0200 Subject: [PATCH] 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. --- src/hlua.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hlua.c b/src/hlua.c index ceeeace6e..966ed5adb 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -907,6 +907,7 @@ void hlua_ctx_destroy(struct hlua *lua) /* The thread is garbage collected by Lua. */ luaL_unref(lua->T, LUA_REGISTRYINDEX, lua->Mref); luaL_unref(gL.T, LUA_REGISTRYINDEX, lua->Tref); + lua->T = NULL; } /* This function is used to restore the Lua context when a coroutine