1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-04-24 23:36:50 +00:00

Don't destroy root widget for new elements

This commit is contained in:
uramer 2024-03-12 17:46:38 +01:00
parent dce0a9e11e
commit b12f98db98

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;
} }
} }
}