mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-11-15 21:25:44 +08:00
Fixed memory leak
This commit is contained in:
parent
03b1848b43
commit
543d226ba3
@ -131,8 +131,6 @@ public:
|
||||
{
|
||||
LayoutItem->widget()->setParent(nullptr);
|
||||
}
|
||||
delete LayoutItem;
|
||||
|
||||
m_CurrentWidget = nullptr;
|
||||
m_CurrentIndex = -1;
|
||||
}
|
||||
@ -172,7 +170,12 @@ public:
|
||||
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);
|
||||
if (prev)
|
||||
|
Loading…
Reference in New Issue
Block a user