mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-04-01 02:42:39 +08:00
Fixed memory leak
This commit is contained in:
parent
03b1848b43
commit
543d226ba3
@ -131,8 +131,6 @@ public:
|
|||||||
{
|
{
|
||||||
LayoutItem->widget()->setParent(nullptr);
|
LayoutItem->widget()->setParent(nullptr);
|
||||||
}
|
}
|
||||||
delete LayoutItem;
|
|
||||||
|
|
||||||
m_CurrentWidget = nullptr;
|
m_CurrentWidget = nullptr;
|
||||||
m_CurrentIndex = -1;
|
m_CurrentIndex = -1;
|
||||||
}
|
}
|
||||||
@ -172,7 +170,12 @@ public:
|
|||||||
parent->setUpdatesEnabled(false);
|
parent->setUpdatesEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete m_ParentLayout->takeAt(1);
|
auto LayoutItem = m_ParentLayout->takeAt(1);
|
||||||
|
if (LayoutItem)
|
||||||
|
{
|
||||||
|
LayoutItem->widget()->setParent(nullptr);
|
||||||
|
}
|
||||||
|
delete LayoutItem;
|
||||||
|
|
||||||
m_ParentLayout->addWidget(next);
|
m_ParentLayout->addWidget(next);
|
||||||
if (prev)
|
if (prev)
|
||||||
|
Loading…
Reference in New Issue
Block a user