Some lua state allocator fixes

Run GC on the themeroom lua states, as they're not freed
until end of game.

Allocate the exact amount of data we use instead of padding it.

Free our state data after closing the lua state; doing it
the other way is the way to madness, which was kept at bay
by the padded allocation amount.
This commit is contained in:
Pasi Kallinen
2024-01-17 17:01:36 +02:00
parent 6b8079a16f
commit 5d28e24477
2 changed files with 11 additions and 16 deletions

View File

@@ -335,6 +335,7 @@ makerooms(void)
wallification(1, 0, COLNO - 1, ROWNO - 1);
free(gc.coder);
gc.coder = NULL;
lua_gc(themes, LUA_GCCOLLECT);
}
}