From 9eb3230b7ca3516151f28998020d48ae44d204da Mon Sep 17 00:00:00 2001 From: Thierry Fournier Date: Sat, 28 Nov 2020 11:15:14 +0100 Subject: [PATCH] MINOR: lua-thread: hlua_ctx_renew() is never called with main gL lua state The goal is no longer using "struct hlua" with global main lua_state. if somewhere in the code, hlua_ctx_renew() is called with a global Lua context, we have a serious bug. A crash is better than working with this bug, so this patch remove a useless control. In other way, this control were used during hlua_post_init() function. The function hlua_post_init() used a call to the runtime hlua_ctx_resume() function. This call no longer exists. --- src/hlua.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/hlua.c b/src/hlua.c index ec75181..6530a39 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -1086,10 +1086,6 @@ static int hlua_ctx_renew(struct hlua *lua, int keep_msg) lua_State *T; int new_ref; - /* Renew the main LUA stack doesn't have sense. */ - if (lua == &gL) - return 0; - /* New Lua coroutine. */ T = lua_newthread(gL.T); if (!T) -- 1.7.10.4