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

(cherry picked from commit 364bc91)

c6eed2a Fix bug in LuaUi::Element::destroy() that sometimes leads to an infinite loop on UI cleanup
  • Loading branch information
psi29a committed May 21, 2023
1 parent 0e141dc commit 4f919d9
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 @@ -217,12 +217,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 4f919d9

Please sign in to comment.