From d07abcc6c7064040c15444a7727c39c707130f60 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 17 Feb 2009 16:47:58 -0300 Subject: finalizers always called protected --- lstate.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'lstate.c') diff --git a/lstate.c b/lstate.c index c57b11d6..be7eed91 100644 --- a/lstate.c +++ b/lstate.c @@ -1,5 +1,5 @@ /* -** $Id: lstate.c,v 2.46 2008/08/13 17:01:33 roberto Exp roberto $ +** $Id: lstate.c,v 2.47 2008/08/26 13:27:42 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -199,25 +199,13 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { } -static void callallgcTM (lua_State *L, void *ud) { - UNUSED(ud); - luaC_callAllGCTM(L); /* call GC metamethods for all udata */ -} - - 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); - L->errfunc = 0; /* no error function during GC metamethods */ - do { /* repeat until no more errors */ - L->ci = L->base_ci; - L->base = L->top = L->ci->base; - G(L)->nCcalls = 0; - } while (luaD_rawrunprotected(L, callallgcTM, NULL) != LUA_OK); - lua_assert(G(L)->tobefnz == NULL); + luaC_callAllGCTM(L); /* call GC metamethods for all udata */ luai_userstateclose(L); close_state(L); } -- cgit v1.2.3-55-g6feb