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

@@ -181,9 +181,9 @@ bool AndroidToolChain::operator ==(const ToolChain &tc) const
return m_ndkToolChainVersion == static_cast<const AndroidToolChain &>(tc).m_ndkToolChainVersion;
}
ToolChainConfigWidget *AndroidToolChain::configurationWidget()
std::unique_ptr<ToolChainConfigWidget> AndroidToolChain::createConfigurationWidget()
{
return new AndroidToolChainConfigWidget(this);
return std::make_unique<AndroidToolChainConfigWidget>(this);
}
FileName AndroidToolChain::suggestedDebugger() const