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

macos_ci_fix
uramer 1 year ago
parent 11ae1a1fcb
commit e1cbeb0d3b

@ -216,13 +216,14 @@ namespace LuaUi
void Element::destroy()
{
sAllElements.erase(this);
if (!mRoot)
return;
if (mRoot)
{
destroyWidget(mRoot);
mRoot = nullptr;
mLayout = sol::make_object(mLayout.lua_state(), sol::nil);
}
sAllElements.erase(this);
}
void Element::attachToWidget(WidgetExtension* w)
{

Loading…
Cancel
Save