1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-28 23:39:43 +00:00

Merge branch 'fix_destroying_new_elements' into 'master'

Don't destroy root widget for new elements

See merge request OpenMW/openmw!3947
This commit is contained in:
psi29a 2024-03-14 08:37:13 +00:00
commit 2764d8ceff

View file

@ -313,11 +313,14 @@ namespace LuaUi
{ {
if (mState != Destroyed) if (mState != Destroyed)
{ {
if (mState != New)
{
assert(mRoot);
destroyRoot(mRoot); destroyRoot(mRoot);
mRoot = nullptr; mRoot = nullptr;
if (mState != New) }
mLayout = sol::make_object(mLayout.lua_state(), sol::nil); mLayout = sol::make_object(mLayout.lua_state(), sol::nil);
}
mState = Destroyed; mState = Destroyed;
} }
} }
}