1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-30 09:15:38 +00:00

Error when encountering destroyed widgets

This commit is contained in:
uramer 2023-11-11 13:46:16 +01:00
parent a36360cbde
commit 919e067ab7

View file

@ -113,6 +113,8 @@ namespace LuaUi
std::shared_ptr<Element> element = child.as<std::shared_ptr<Element>>();
if (ext != element->mRoot)
destroyChild(ext);
if (!element->mRoot)
throw std::logic_error("Using a destroyed element as a layout child");
result[i] = element->mRoot;
element->mRoot->updateCoord();
}
@ -139,6 +141,8 @@ namespace LuaUi
if (child.is<Element>())
{
std::shared_ptr<Element> element = child.as<std::shared_ptr<Element>>();
if (!element->mRoot)
throw std::logic_error("Using a destroyed element as a layout child");
result[i] = element->mRoot;
element->mRoot->updateCoord();
}