forked from qt-creator/qt-creator
Fix memory leak in QtVersions parsing of qmake.conf
Reviewed-By: ossi
This commit is contained in:
@@ -742,29 +742,32 @@ ProItem::ProItemReturn ProFileEvaluator::Private::visitEndProFile(ProFile * pro)
|
|||||||
m_lineNo = pro->lineNumber();
|
m_lineNo = pro->lineNumber();
|
||||||
if (m_profileStack.count() == 1 && !m_oldPath.isEmpty()) {
|
if (m_profileStack.count() == 1 && !m_oldPath.isEmpty()) {
|
||||||
const QString &mkspecDirectory = propertyValue(QLatin1String("QMAKE_MKSPECS"));
|
const QString &mkspecDirectory = propertyValue(QLatin1String("QMAKE_MKSPECS"));
|
||||||
if (!mkspecDirectory.isEmpty() && m_parsePreAndPostFiles) {
|
if (!mkspecDirectory.isEmpty()) {
|
||||||
bool cumulative = m_cumulative;
|
if (m_parsePreAndPostFiles) {
|
||||||
m_cumulative = false;
|
bool cumulative = m_cumulative;
|
||||||
|
m_cumulative = false;
|
||||||
|
|
||||||
evaluateFile(mkspecDirectory + QLatin1String("/features/default_post.prf"));
|
evaluateFile(mkspecDirectory + QLatin1String("/features/default_post.prf"));
|
||||||
|
|
||||||
QSet<QString> processed;
|
QSet<QString> processed;
|
||||||
forever {
|
forever {
|
||||||
bool finished = true;
|
bool finished = true;
|
||||||
QStringList configs = valuesDirect(QLatin1String("CONFIG"));
|
QStringList configs = valuesDirect(QLatin1String("CONFIG"));
|
||||||
for (int i = configs.size() - 1; i >= 0; --i) {
|
for (int i = configs.size() - 1; i >= 0; --i) {
|
||||||
const QString config = configs[i].toLower();
|
const QString config = configs[i].toLower();
|
||||||
if (!processed.contains(config)) {
|
if (!processed.contains(config)) {
|
||||||
processed.insert(config);
|
processed.insert(config);
|
||||||
if (evaluateFile(mkspecDirectory + QLatin1String("/features/")
|
if (evaluateFile(mkspecDirectory + QLatin1String("/features/")
|
||||||
+ config + QLatin1String(".prf"))) {
|
+ config + QLatin1String(".prf"))) {
|
||||||
finished = false;
|
finished = false;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (finished)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (finished)
|
m_cumulative = cumulative;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (ProBlock *itm, m_replaceFunctions)
|
foreach (ProBlock *itm, m_replaceFunctions)
|
||||||
@@ -773,8 +776,6 @@ ProItem::ProItemReturn ProFileEvaluator::Private::visitEndProFile(ProFile * pro)
|
|||||||
foreach (ProBlock *itm, m_testFunctions)
|
foreach (ProBlock *itm, m_testFunctions)
|
||||||
itm->deref();
|
itm->deref();
|
||||||
m_testFunctions.clear();
|
m_testFunctions.clear();
|
||||||
|
|
||||||
m_cumulative = cumulative;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_profileStack.pop();
|
m_profileStack.pop();
|
||||||
|
|||||||
Reference in New Issue
Block a user