lua

A copy of the Lua development repository
Log | Files | Refs | README

commit d31c04c0498bd78a99a15fc8980844da6882914d
parent 522481a788ee33d68389e0e32f498b7a3e304d39
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Thu,  6 Oct 2005 17:46:03 -0300

missing macros 'luai_userstate*'

Diffstat:
Mlstate.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lstate.c b/lstate.c @@ -1,5 +1,5 @@ /* -** $Id: lstate.c,v 2.33 2005/08/25 15:39:16 roberto Exp roberto $ +** $Id: lstate.c,v 2.34 2005/09/20 17:55:53 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -134,6 +134,7 @@ lua_State *luaE_newthread (lua_State *L) { void luaE_freethread (lua_State *L, lua_State *L1) { luaF_close(L1, L1->stack); /* close all upvalues for this thread */ lua_assert(L1->openupval == NULL); + luai_userstatefree(L1); freestack(L, L1); luaM_freemem(L, fromstate(L1), state_size(lua_State)); } @@ -196,8 +197,9 @@ static void callallgcTM (lua_State *L, void *ud) { LUA_API void lua_close (lua_State *L) { - lua_lock(L); L = G(L)->mainthread; /* only the main thread can be closed */ + luai_userstateclose(L); + lua_lock(L); luaF_close(L, L->stack); /* close all upvalues for this thread */ luaC_separateudata(L, 1); /* separate udata that have GC metamethods */ L->errfunc = 0; /* no error function during GC metamethods */