Skip to content

Commit

Permalink
Fix bug in LuaUi::Element::destroy() that sometimes leads to an infin…
Browse files Browse the repository at this point in the history
…ite loop on UI cleanup
  • Loading branch information
petrmikheev committed May 20, 2023
1 parent 5f6ca2a commit c6eed2a
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 c6eed2a

Please sign in to comment.