ProjectExplorer: Fix memory leaks in tree models

Fix widgets being leaked by the ToolChainOptionsPage.
This page created widgets and stored them in the tree node
and never deleted them.

The fix is to put all the widgets into one QStackedWidget, so
that this will clean up once the page is destroyed.

Change-Id: Ic02824a4c52771d8962dc594176077c2e139fb84
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-07-11 08:25:07 +02:00
parent 263cf4c608
commit 2c0554c187
15 changed files with 38 additions and 33 deletions

View File

@@ -281,6 +281,7 @@ QList<ToolChain *> ToolChainSettingsAccessor::toolChains(const QVariantMap &data
#include "headerpath.h"
#include "abi.h"
#include "toolchainconfigwidget.h"
#include <QSet>
#include <QTest>
@@ -318,7 +319,7 @@ public:
QString makeCommand(const Environment &env) const override { Q_UNUSED(env); return QString("make"); }
FileName compilerCommand() const override { return Utils::FileName::fromString("/tmp/test/gcc"); }
IOutputParser *outputParser() const override { return nullptr; }
ToolChainConfigWidget *configurationWidget() override { return nullptr; }
std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override { return nullptr; }
TTC *clone() const override { return new TTC(*this); }
bool operator ==(const ToolChain &other) const override {
if (!ToolChain::operator==(other))