aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/autotest/autotestplugin.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2020-03-06 09:44:11 +0100
committerEike Ziller <eike.ziller@qt.io>2020-03-06 09:44:11 +0100
commit8f89c9a846d6e8e3e1f8c7d59575ad7de57b697c (patch)
treec50db178f4744b268ca8496e23fc343a923444c9 /src/plugins/autotest/autotestplugin.cpp
parente5f4cfbeb8ece9557bf07cc4f82eafc4a4bd2568 (diff)
parent8bb3b3c4f1bf36eca3c173626c2300fc3c04fc15 (diff)
Merge remote-tracking branch 'origin/4.12'
Diffstat (limited to 'src/plugins/autotest/autotestplugin.cpp')
-rw-r--r--src/plugins/autotest/autotestplugin.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/plugins/autotest/autotestplugin.cpp b/src/plugins/autotest/autotestplugin.cpp
index 0158b3b3f74..1f7a740c5d1 100644
--- a/src/plugins/autotest/autotestplugin.cpp
+++ b/src/plugins/autotest/autotestplugin.cpp
@@ -149,15 +149,27 @@ AutotestPluginPrivate::AutotestPluginPrivate(AutotestPlugin *parent)
m_frameworkManager->activateFrameworksFromSettings(&m_settings);
TestTreeModel::instance()->synchronizeTestFrameworks();
- connect(ProjectExplorer::SessionManager::instance(),
- &ProjectExplorer::SessionManager::startupProjectChanged, this, [this] {
- m_runconfigCache.clear();
+ auto sessionManager = ProjectExplorer::SessionManager::instance();
+ connect(sessionManager, &ProjectExplorer::SessionManager::startupProjectChanged,
+ this, [this] { m_runconfigCache.clear(); });
+
+ connect(sessionManager, &ProjectExplorer::SessionManager::aboutToRemoveProject,
+ this, [this] (ProjectExplorer::Project *project) {
+ auto it = s_projectSettings.find(project);
+ if (it != s_projectSettings.end()) {
+ delete it.value();
+ s_projectSettings.erase(it);
+ }
});
-
}
AutotestPluginPrivate::~AutotestPluginPrivate()
{
+ if (!s_projectSettings.isEmpty()) {
+ qDeleteAll(s_projectSettings.values());
+ s_projectSettings.clear();
+ }
+
delete m_navigationWidgetFactory;
delete m_resultsPane;
delete m_frameworkManager;