Commit 83016e47 authored by dt's avatar dt
Browse files

Fix leaking PropertiesPanels

parent 876bce49
......@@ -737,6 +737,8 @@ ProjectWindow::ProjectWindow(QWidget *parent)
ProjectWindow::~ProjectWindow()
{
qDeleteAll(m_panels);
m_panels.clear();
}
void ProjectWindow::projectAdded()
......@@ -775,6 +777,9 @@ void ProjectWindow::showProperties(Project *project)
// Remove the tabs from the tab widget first
m_panelsWidget->clear();
qDeleteAll(m_panels);
m_panels.clear();
m_panelsWidget->addWidget(tr("Active Build and Run Configurations"), m_activeConfigurationWidget);
m_panelsWidget->addWidget(m_spacerBetween);
m_panelsWidget->addWidget(m_projectChooser);
......@@ -788,6 +793,7 @@ void ProjectWindow::showProperties(Project *project)
if (debug)
qDebug() << "ProjectWindow - setting up project properties tab " << panel->name();
m_panelsWidget->addWidget(panel->name(), panel->widget());
m_panels.push_back(panel);
}
}
}
......
......@@ -191,6 +191,7 @@ private:
QWidget *m_projectChooser;
QLabel *m_noprojectLabel;
PanelsWidget *m_panelsWidget;
QList<PropertiesPanel *> m_panels;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment