fix access to free()d memory

the 'item' reference may become invalid inside the loop.

this approach was chosen (instead of making 'item' a non-reference) to
keep the code more in sync with creator (where the string type is more
complex).

Change-Id: I60a4b0654dc47c0e3466d43904c358eb7e3e64e2
Reviewed-By: Marius Storm-Olsen
Reviewed-on: http://codereview.qt.nokia.com/1702
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
This commit is contained in:
Oswald Buddenhagen 2011-07-15 15:39:27 +02:00 committed by Qt by Nokia
parent 412ef92162
commit 68711f6ea7

View File

@ -2289,7 +2289,7 @@ QMakeProject::doProjectExpand(QString func, QList<QStringList> args_list,
ret.prepend(item);
foreach (const QString &dep, dependees[item]) {
QSet<QString> &dset = dependencies[dep];
dset.remove(item);
dset.remove(rootSet.at(i)); // *Don't* use 'item' - rootSet may have changed!
if (dset.isEmpty())
rootSet << dep;
}