From d56d4cf776b2a874e35d7a92c506840f4a2051b6 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 11 Jan 2002 18:26:52 -0200 Subject: distinct functions to create/destroy states and threads --- lgc.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lgc.c') diff --git a/lgc.c b/lgc.c index 64eee046..696c726c 100644 --- a/lgc.c +++ b/lgc.c @@ -126,6 +126,12 @@ static void markstacks (GCState *st) { lua_State *L1 = st->L; do { /* for each thread */ StkId o, lim; + if (L1->base_ci == NULL) { /* incomplete state? */ + lua_assert(L1 != st->L); + L1 = L1->next; + luaE_closethread(st->L, L1->previous); /* collect it */ + continue; + } for (o=L1->stack; otop; o++) markobject(st, o); lim = (L1->stack_last - L1->ci->base > MAXSTACK) ? L1->ci->base+MAXSTACK -- cgit v1.2.3-55-g6feb