Don't free ui element's shared_ptr right before destroying it

macos_ci_fix
uramer 1 year ago
parent 11ae1a1fcb
commit e1cbeb0d3b

@ -216,12 +216,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…
Cancel
Save