1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-04 02:41:19 +00:00

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

This commit is contained in:
Petr Mikheev 2023-05-20 02:30:12 +02:00
parent 5f6ca2a6d1
commit c6eed2a6c6

View File

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