aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qtsupport/profilereader.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-08-14 18:30:29 +0200
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2018-03-14 15:34:01 +0000
commit60245e55d7551f525c951d8d866aab081be88a69 (patch)
treea835326ccc87ea93d7c749f9f0f42f27d8ab1db2 /src/plugins/qtsupport/profilereader.cpp
parent274726efb0bbc5055f02b1b76f2481564ad27f46 (diff)
qmake: Change source identifier type in ProString
The strings remember in which file they were created/assigned. However, this used a non-counting reference to a ProFile, which could become dangling. If a subsequent ProFile re-used the exact same address, a string's source would be mis-identified, which would be fatal in conjunction with discard_from(). Since we actually need only a unique id for comparison, let's use an integer for that. comment on cherry-pick: this is actually a lot more than a cherry-pick, because the file ids need to be aware of the dual VFS which was concurrently introduced on the qtc side. Started-by: Simon Hausmann <simon.hausmann@qt.io> Change-Id: I395153afaf7c835d0119690ee7f4b915e6f90d4a (cherry picked from qtbase/190aa94be7f5e146bef44862b974d733755cec85) Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src/plugins/qtsupport/profilereader.cpp')
-rw-r--r--src/plugins/qtsupport/profilereader.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/qtsupport/profilereader.cpp b/src/plugins/qtsupport/profilereader.cpp
index 0985a64b750..86ec0f16d7f 100644
--- a/src/plugins/qtsupport/profilereader.cpp
+++ b/src/plugins/qtsupport/profilereader.cpp
@@ -166,16 +166,17 @@ void ProFileCacheManager::clear()
// loop is concerned. Use a shared pointer once this is not true anymore.
delete m_cache;
m_cache = 0;
+ QMakeVfs::clearIds();
}
-void ProFileCacheManager::discardFiles(const QString &prefix)
+void ProFileCacheManager::discardFiles(const QString &prefix, QMakeVfs *vfs)
{
if (m_cache)
- m_cache->discardFiles(prefix);
+ m_cache->discardFiles(prefix, vfs);
}
-void ProFileCacheManager::discardFile(const QString &fileName)
+void ProFileCacheManager::discardFile(const QString &fileName, QMakeVfs *vfs)
{
if (m_cache)
- m_cache->discardFile(fileName);
+ m_cache->discardFile(fileName, vfs);
}