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:
parent
a36360cbde
commit
919e067ab7
1 changed files with 4 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue