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

Merge branch 'crash_temporary_ui_element' into 'master'

Fix crash #7469

See merge request OpenMW/openmw!3367

(cherry picked from commit 42469c4b54)

e1cbeb0d Don't free ui element's shared_ptr right before destroying it
This commit is contained in:
psi29a 2023-08-21 09:25:30 +00:00
parent 81ab0feb2e
commit a63d7e473e

View file

@ -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)