summaryrefslogtreecommitdiff
path: root/lstate.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-10-03 14:54:25 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-10-03 14:54:25 -0300
commit6d86b937e48718c9f6a7dd0af0ad9f0112002d9f (patch)
treec8b4f4dee4f9cbaa5652eb4afb2dc3b5c61b65d4 /lstate.c
parentbc90cf4b8313d88adc0c6e45961e3b4881a9566a (diff)
downloadlua-github-6d86b937e48718c9f6a7dd0af0ad9f0112002d9f.tar.gz
'luaC_separateudata' called from 'luaC_freeallobjects' + removed
extra 'luaF_close' (already being called by 'close_state')
Diffstat (limited to 'lstate.c')
-rw-r--r--lstate.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lstate.c b/lstate.c
index 64b03dc1..bc13897b 100644
--- a/lstate.c
+++ b/lstate.c
@@ -1,5 +1,5 @@
/*
-** $Id: lstate.c,v 2.90 2011/08/09 20:58:29 roberto Exp roberto $
+** $Id: lstate.c,v 2.91 2011/08/23 17:24:34 roberto Exp roberto $
** Global State
** See Copyright Notice in lua.h
*/
@@ -192,7 +192,7 @@ static void close_state (lua_State *L) {
luaZ_freebuffer(L, &g->buff);
freestack(L);
lua_assert(gettotalbytes(g) == sizeof(LG));
- (*g->frealloc)(g->ud, fromstate(L), sizeof(LG), 0);
+ (*g->frealloc)(g->ud, fromstate(L), sizeof(LG), 0); /* free main block */
}
@@ -279,9 +279,6 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) {
LUA_API void lua_close (lua_State *L) {
L = G(L)->mainthread; /* only the main thread can be closed */
lua_lock(L);
- luaF_close(L, L->stack); /* close all upvalues for this thread */
- luaC_separateudata(L, 1); /* separate all udata with GC metamethods */
- lua_assert(L->next == NULL);
luai_userstateclose(L);
close_state(L);
}