1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-30 16:20:21 +00:00

Merge branch 'fix_element_destroy' into 'master'

Fix bug in LuaUi::Element::destroy() that sometimes leads to an infinite loop on UI cleanup

See merge request OpenMW/openmw!3033
This commit is contained in:
psi29a 2023-05-21 17:33:56 +00:00
commit 364bc91f5b

View File

@ -216,12 +216,12 @@ namespace LuaUi
void Element::destroy() void Element::destroy()
{ {
sAllElements.erase(this);
if (!mRoot) if (!mRoot)
return; return;
destroyWidget(mRoot); destroyWidget(mRoot);
mRoot = nullptr; mRoot = nullptr;
mLayout = sol::make_object(mLayout.lua_state(), sol::nil); mLayout = sol::make_object(mLayout.lua_state(), sol::nil);
sAllElements.erase(this);
} }
void Element::attachToWidget(WidgetExtension* w) void Element::attachToWidget(WidgetExtension* w)