diff --git a/src/lua_script.c b/src/lua_script.c index 14cdee2d7..0db0bd1e0 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -623,6 +623,10 @@ void LUA_InvalidateLevel(void) LUA_InvalidateUserdata(&slope->o); LUA_InvalidateUserdata(&slope->d); } + + // We invalidated a lot of userdata objects, a lot of them probably ended up unreachable so they can be + // GC'd right away + lua_gc(gL, LUA_GCCOLLECT, 0); } void LUA_InvalidateMapthings(void)