diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-12-10 20:11:23 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-12-10 20:11:23 -0200 |
commit | e043b72a55493cde9bb9c19997a4d58bac444630 (patch) | |
tree | f3ed54ec1dcead65454931ad2a86ebb2a3ea3a15 /lstate.c | |
parent | a4c35a3269f0581da212b3c4abd04989f88425ce (diff) | |
download | lua-e043b72a55493cde9bb9c19997a4d58bac444630.tar.gz lua-e043b72a55493cde9bb9c19997a4d58bac444630.tar.bz2 lua-e043b72a55493cde9bb9c19997a4d58bac444630.zip |
simpler way to collect userdata
Diffstat (limited to 'lstate.c')
-rw-r--r-- | lstate.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -116,7 +116,8 @@ static void close_state (lua_State *L, lua_State *OL) { | |||
116 | L->next->previous = L->previous; | 116 | L->next->previous = L->previous; |
117 | } | 117 | } |
118 | else if (G(L)) { /* last thread; close global state */ | 118 | else if (G(L)) { /* last thread; close global state */ |
119 | luaC_callallgcTM(L); /* call GC tag methods for all udata */ | 119 | if (G(L)->rootudata) /* (avoid problems with incomplete states) */ |
120 | luaC_callallgcTM(L); /* call GC tag methods for all udata */ | ||
120 | luaC_collect(L, 1); /* collect all elements */ | 121 | luaC_collect(L, 1); /* collect all elements */ |
121 | lua_assert(G(L)->rootproto == NULL); | 122 | lua_assert(G(L)->rootproto == NULL); |
122 | lua_assert(G(L)->rootudata == NULL); | 123 | lua_assert(G(L)->rootudata == NULL); |