mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-31 13:36:44 +00:00
Fix bug in LuaUi::Element::destroy() that sometimes leads to an infinite loop on UI cleanup
This commit is contained in:
parent
5f6ca2a6d1
commit
c6eed2a6c6
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue