From c4e8d38e305dc7422ab7df48f1d63b72fb2ab63c Mon Sep 17 00:00:00 2001 From: Petr Mikheev Date: Tue, 31 Jan 2023 07:57:12 +0000 Subject: [PATCH] Do several passes of garbage collecting in LuaManager::clear() --- apps/openmw/mwlua/luamanagerimp.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/openmw/mwlua/luamanagerimp.cpp b/apps/openmw/mwlua/luamanagerimp.cpp index 2dfb5dbc35..8827498cb6 100644 --- a/apps/openmw/mwlua/luamanagerimp.cpp +++ b/apps/openmw/mwlua/luamanagerimp.cpp @@ -313,6 +313,8 @@ namespace MWLua } mGlobalStorage.clearTemporaryAndRemoveCallbacks(); mPlayerStorage.clearTemporaryAndRemoveCallbacks(); + for (int i = 0; i < 5; ++i) + lua_gc(mLua.sol(), LUA_GCCOLLECT, 0); } void LuaManager::setupPlayer(const MWWorld::Ptr& ptr)