From 0fcad65d6fcde2249dae53a7c14e7e27d60009ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Fri, 28 Jan 2022 08:03:14 +0100 Subject: [PATCH] Fix crash on exit if any modern particle callback is registered All these smart pointers have to be cleared before the Lua state is closed. Ordinarily, we'd have a smart pointer to the Lua state defined earlier in LSI than these smart pointers, which would take care of destruction in the correct order, but tfw technical debt. --- src/lua/LuaScriptInterface.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lua/LuaScriptInterface.cpp b/src/lua/LuaScriptInterface.cpp index cee690e1a..589c94562 100644 --- a/src/lua/LuaScriptInterface.cpp +++ b/src/lua/LuaScriptInterface.cpp @@ -4382,6 +4382,10 @@ LuaScriptInterface::~LuaScriptInterface() { component_and_ref.second.Clear(); component_and_ref.first->owner_ref = component_and_ref.second; } + luaChangeTypeHandlers.clear(); + luaCreateAllowedHandlers.clear(); + luaCreateHandlers.clear(); + luaCtypeDrawHandlers.clear(); lua_el_mode_v.clear(); lua_el_func_v.clear(); lua_gr_func_v.clear();