diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-10-03 14:54:25 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-10-03 14:54:25 -0300 |
commit | 6d86b937e48718c9f6a7dd0af0ad9f0112002d9f (patch) | |
tree | c8b4f4dee4f9cbaa5652eb4afb2dc3b5c61b65d4 /lstate.c | |
parent | bc90cf4b8313d88adc0c6e45961e3b4881a9566a (diff) | |
download | lua-6d86b937e48718c9f6a7dd0af0ad9f0112002d9f.tar.gz lua-6d86b937e48718c9f6a7dd0af0ad9f0112002d9f.tar.bz2 lua-6d86b937e48718c9f6a7dd0af0ad9f0112002d9f.zip |
'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.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.c,v 2.90 2011/08/09 20:58:29 roberto Exp roberto $ | 2 | ** $Id: lstate.c,v 2.91 2011/08/23 17:24:34 roberto Exp roberto $ |
3 | ** Global State | 3 | ** Global State |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -192,7 +192,7 @@ static void close_state (lua_State *L) { | |||
192 | luaZ_freebuffer(L, &g->buff); | 192 | luaZ_freebuffer(L, &g->buff); |
193 | freestack(L); | 193 | freestack(L); |
194 | lua_assert(gettotalbytes(g) == sizeof(LG)); | 194 | lua_assert(gettotalbytes(g) == sizeof(LG)); |
195 | (*g->frealloc)(g->ud, fromstate(L), sizeof(LG), 0); | 195 | (*g->frealloc)(g->ud, fromstate(L), sizeof(LG), 0); /* free main block */ |
196 | } | 196 | } |
197 | 197 | ||
198 | 198 | ||
@@ -279,9 +279,6 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { | |||
279 | LUA_API void lua_close (lua_State *L) { | 279 | LUA_API void lua_close (lua_State *L) { |
280 | L = G(L)->mainthread; /* only the main thread can be closed */ | 280 | L = G(L)->mainthread; /* only the main thread can be closed */ |
281 | lua_lock(L); | 281 | lua_lock(L); |
282 | luaF_close(L, L->stack); /* close all upvalues for this thread */ | ||
283 | luaC_separateudata(L, 1); /* separate all udata with GC metamethods */ | ||
284 | lua_assert(L->next == NULL); | ||
285 | luai_userstateclose(L); | 282 | luai_userstateclose(L); |
286 | close_state(L); | 283 | close_state(L); |
287 | } | 284 | } |