mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-25 07:31:33 +08:00
Fix memory leaks (#314)
This commit is contained in:
parent
ffa0105d3e
commit
2f041a0eed
@ -505,6 +505,20 @@ CDockManager::CDockManager(QWidget *parent) :
|
|||||||
//============================================================================
|
//============================================================================
|
||||||
CDockManager::~CDockManager()
|
CDockManager::~CDockManager()
|
||||||
{
|
{
|
||||||
|
// fix memory leaks, see https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues/307
|
||||||
|
std::vector<ads::CDockAreaWidget*> areas;
|
||||||
|
for ( int i = 0; i != dockAreaCount(); ++i )
|
||||||
|
{
|
||||||
|
areas.push_back( dockArea(i) );
|
||||||
|
}
|
||||||
|
for ( auto area : areas )
|
||||||
|
{
|
||||||
|
for ( auto widget : area->dockWidgets() )
|
||||||
|
delete widget;
|
||||||
|
|
||||||
|
delete area;
|
||||||
|
}
|
||||||
|
|
||||||
auto FloatingWidgets = d->FloatingWidgets;
|
auto FloatingWidgets = d->FloatingWidgets;
|
||||||
for (auto FloatingWidget : FloatingWidgets)
|
for (auto FloatingWidget : FloatingWidgets)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user