commit 6d86b937e48718c9f6a7dd0af0ad9f0112002d9f
parent bc90cf4b8313d88adc0c6e45961e3b4881a9566a
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Mon, 3 Oct 2011 14:54:01 -0300
'luaC_separateudata' called from 'luaC_freeallobjects' + removed
extra 'luaF_close' (already being called by 'close_state')
Diffstat:
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git 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);
}