DeployConfiguration: fix memory leak

The ctor creates a m_stepList, which we need thus delete in fromMap.
Likely the m_stepList could simply be initialized with null in the
ctor.

Change-Id: I3fdb31b135b4b6ea528e0666117b63c2b39764cf
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Daniel Teske
2012-09-12 18:05:12 +02:00
committed by Daniel Teske
parent fe2dd584fc
commit 75b090e619

View File

@@ -116,6 +116,7 @@ bool DeployConfiguration::fromMap(const QVariantMap &map)
return false; return false;
QVariantMap data = map.value(QLatin1String(BUILD_STEP_LIST_PREFIX) + QLatin1String("0")).toMap(); QVariantMap data = map.value(QLatin1String(BUILD_STEP_LIST_PREFIX) + QLatin1String("0")).toMap();
if (!data.isEmpty()) { if (!data.isEmpty()) {
delete m_stepList;
m_stepList = new BuildStepList(this, data); m_stepList = new BuildStepList(this, data);
if (m_stepList->isNull()) { if (m_stepList->isNull()) {
qWarning() << "Failed to restore deploy step list"; qWarning() << "Failed to restore deploy step list";