From 2f3867f429a7a7f04b54a614d85291831736da83 Mon Sep 17 00:00:00 2001 From: Thierry FOURNIER Date: Mon, 28 Sep 2015 01:02:01 +0200 Subject: [PATCH] BUG/MEDIUM: lua: don't reset undesired flags in hlua_ctx_resume Some flags like HLUA_MUST_GC must not be cleared otherwise sessions are not properly cleaned. --- src/hlua.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hlua.c b/src/hlua.c index d205a3879..2682129b5 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -1034,8 +1034,6 @@ static enum hlua_exec hlua_ctx_resume(struct hlua *lua, int yield_allowed) int ret; const char *msg; - HLUA_SET_RUN(lua); - /* If we want to resume the task, then check first the execution timeout. * if it is reached, we can interrupt the Lua processing. */ @@ -1050,7 +1048,10 @@ resume_execution: lua_sethook(lua->T, hlua_hook, LUA_MASKCOUNT, hlua_nb_instruction); /* Remove all flags except the running flags. */ - lua->flags = HLUA_RUN; + HLUA_SET_RUN(lua); + HLUA_CLR_CTRLYIELD(lua); + HLUA_CLR_WAKERESWR(lua); + HLUA_CLR_WAKEREQWR(lua); /* Call the function. */ ret = lua_resume(lua->T, gL.T, lua->nargs);