mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Fix userdata __gc separations at state close.
This commit is contained in:
parent
58ec704f78
commit
58622937c0
@ -243,16 +243,16 @@ LUA_API void lua_close(lua_State *L)
|
||||
G2J(g)->state = LJ_TRACE_IDLE;
|
||||
lj_dispatch_update(g);
|
||||
#endif
|
||||
for (i = 0; i < 10; ) {
|
||||
for (i = 0;;) {
|
||||
hook_enter(g);
|
||||
L->status = 0;
|
||||
L->cframe = NULL;
|
||||
L->base = L->top = tvref(L->stack) + 1;
|
||||
if (lj_vm_cpcall(L, NULL, NULL, cpfinalize) == 0) {
|
||||
if (++i >= 10) break;
|
||||
lj_gc_separateudata(g, 1); /* Separate udata again. */
|
||||
if (gcref(g->gc.mmudata) == NULL) /* Until nothing is left to do. */
|
||||
break;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
close_state(L);
|
||||
|
Loading…
Reference in New Issue
Block a user