Skip to content

Commit

Permalink
Merge branch 'fix_element_destroy' into 'master'
Browse files Browse the repository at this point in the history
Fix bug in LuaUi::Element::destroy() that sometimes leads to an infinite loop on UI cleanup

See merge request OpenMW/openmw!3033
  • Loading branch information
psi29a committed May 21, 2023
2 parents 458ee4a + c6eed2a commit 364bc91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/lua_ui/element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 364bc91

Please sign in to comment.