summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-12-10 10:53:54 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-12-10 10:53:54 -0300
commit1de95e97ef65632a88e08b6184bd9d1ceba7ec2f (patch)
treeaa9376fcefb5124e0743a91e9c9de13a1dd927c0
parentad3942adba574c9d008c99ce2785a5af19d146bf (diff)
downloadlua-github-1de95e97ef65632a88e08b6184bd9d1ceba7ec2f.tar.gz
Bug: Lua stack still active when closing a state
-rw-r--r--lstate.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lstate.c b/lstate.c
index 5cb0847c..547a7a01 100644
--- a/lstate.c
+++ b/lstate.c
@@ -271,6 +271,7 @@ static void close_state (lua_State *L) {
if (!completestate(g)) /* closing a partially built state? */
luaC_freeallobjects(L); /* just collect its objects */
else { /* closing a fully built state */
+ L->ci = &L->base_ci; /* unwind CallInfo list */
luaD_closeprotected(L, 1, LUA_OK); /* close all upvalues */
luaC_freeallobjects(L); /* collect all objects */
luai_userstateclose(L);