Commit cc8d9a68 authored by Daniel Teske's avatar Daniel Teske

Fix crash in Qt Options page

The options page owns the qt vesions and needs to return clones
in versions().

This crash was introduced in 87b15b45

Change-Id: I6b7f4d29c12b10d87f7d0525b2e930e0a9118617
Task-number: QTCREATORBUG-15004
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent 41f5f535
......@@ -81,7 +81,7 @@ public:
~QtVersionItem()
{
delete m_version;
}
void setVersion(BaseQtVersion *version)
......@@ -155,7 +155,7 @@ public:
}
private:
BaseQtVersion *m_version = 0; // not owned
BaseQtVersion *m_version = 0;
QIcon m_icon;
QString m_buildLog;
QByteArray m_toolChainId;
......@@ -693,7 +693,6 @@ void QtOptionsPageWidget::updateQtVersions(const QList<int> &additions, const QL
// Add changed/added items:
foreach (int a, toAdd) {
BaseQtVersion *version = QtVersionManager::version(a)->clone();
//m_versions.append(version);
auto *item = new QtVersionItem(version);
item->setToolChainId(defaultToolChainId(version));
......@@ -1050,7 +1049,7 @@ QList<BaseQtVersion *> QtOptionsPageWidget::versions() const
auto gather = [&result](TreeItem *parent) {
result.reserve(result.size() + parent->childCount());
for (int i = 0; i < parent->childCount(); ++i)
result.append(static_cast<QtVersionItem *>(parent->childAt(i))->version());
result.append(static_cast<QtVersionItem *>(parent->childAt(i))->version()->clone());
};
gather(m_autoItem);
......
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