simpler way to collect userdata
This commit is contained in:
1 parent
a4c35a3269
commit
e043b72a55
2 files changed
+2
-1
No files matched your search
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
|
|
||||||
void luaC_callallgcTM (lua_State *L);
|
void luaC_callallgcTM (lua_State *L);
|
||||||
Udata *luaC_collect (lua_State *L, int all);
|
void luaC_collect (lua_State *L, int all);
|
||||||
void luaC_collectgarbage (lua_State *L);
|
void luaC_collectgarbage (lua_State *L);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ static void close_state (lua_State *L, lua_State *OL) {
|
|||||||
L->next->previous = L->previous;
|
L->next->previous = L->previous;
|
||||||
}
|
}
|
||||||
else if (G(L)) { /* last thread; close global state */
|
else if (G(L)) { /* last thread; close global state */
|
||||||
|
if (G(L)->rootudata) /* (avoid problems with incomplete states) */
|
||||||
luaC_callallgcTM(L); /* call GC tag methods for all udata */
|
luaC_callallgcTM(L); /* call GC tag methods for all udata */
|
||||||
luaC_collect(L, 1); /* collect all elements */
|
luaC_collect(L, 1); /* collect all elements */
|
||||||
lua_assert(G(L)->rootproto == NULL);
|
lua_assert(G(L)->rootproto == NULL);
|
||||||
|
|||||||
Reference in new issue
Block a user