mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-31 01:15:34 +00:00
Merge branch 'crash_temporary_ui_element' into 'master'
Fix crash #7469 See merge request OpenMW/openmw!3367 (cherry picked from commit42469c4b54
)e1cbeb0d
Don't free ui element's shared_ptr right before destroying it
This commit is contained in:
parent
81ab0feb2e
commit
a63d7e473e
1 changed files with 6 additions and 5 deletions
|
@ -217,13 +217,14 @@ namespace LuaUi
|
||||||
|
|
||||||
void Element::destroy()
|
void Element::destroy()
|
||||||
{
|
{
|
||||||
sAllElements.erase(this);
|
if (mRoot)
|
||||||
if (!mRoot)
|
{
|
||||||
return;
|
|
||||||
destroyWidget(mRoot);
|
destroyWidget(mRoot);
|
||||||
mRoot = nullptr;
|
mRoot = nullptr;
|
||||||
mLayout = sol::make_object(mLayout.lua_state(), sol::nil);
|
mLayout = sol::make_object(mLayout.lua_state(), sol::nil);
|
||||||
}
|
}
|
||||||
|
sAllElements.erase(this);
|
||||||
|
}
|
||||||
|
|
||||||
void Element::attachToWidget(WidgetExtension* w)
|
void Element::attachToWidget(WidgetExtension* w)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue