mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-30 13: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,12 +217,13 @@ namespace LuaUi
|
|||
|
||||
void Element::destroy()
|
||||
{
|
||||
if (mRoot)
|
||||
{
|
||||
destroyWidget(mRoot);
|
||||
mRoot = nullptr;
|
||||
mLayout = sol::make_object(mLayout.lua_state(), sol::nil);
|
||||
}
|
||||
sAllElements.erase(this);
|
||||
if (!mRoot)
|
||||
return;
|
||||
destroyWidget(mRoot);
|
||||
mRoot = nullptr;
|
||||
mLayout = sol::make_object(mLayout.lua_state(), sol::nil);
|
||||
}
|
||||
|
||||
void Element::attachToWidget(WidgetExtension* w)
|
||||
|
|
Loading…
Reference in a new issue