mirror of
https://github.com/OpenMW/openmw.git
synced 2025-07-02 15:41:34 +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>>();
|
std::shared_ptr<Element> element = child.as<std::shared_ptr<Element>>();
|
||||||
if (ext != element->mRoot)
|
if (ext != element->mRoot)
|
||||||
destroyChild(ext);
|
destroyChild(ext);
|
||||||
|
if (!element->mRoot)
|
||||||
|
throw std::logic_error("Using a destroyed element as a layout child");
|
||||||
result[i] = element->mRoot;
|
result[i] = element->mRoot;
|
||||||
element->mRoot->updateCoord();
|
element->mRoot->updateCoord();
|
||||||
}
|
}
|
||||||
|
@ -139,6 +141,8 @@ namespace LuaUi
|
||||||
if (child.is<Element>())
|
if (child.is<Element>())
|
||||||
{
|
{
|
||||||
std::shared_ptr<Element> element = child.as<std::shared_ptr<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;
|
result[i] = element->mRoot;
|
||||||
element->mRoot->updateCoord();
|
element->mRoot->updateCoord();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue