diff options
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); |