diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-11-27 09:39:56 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-11-29 07:46:02 +0000 |
commit | 1f998e040eb7202691f4a4eb5fb77499247b2aab (patch) | |
tree | b882edcda165aaa0e4a21b54db42a9970a028fd7 /qmake | |
parent | 09e3457541c54b084365bfb77ad58474f0666374 (diff) |
Fix crash in qmake parsing
The read from a QHash needs to be protected too if other threads are
writing.
sync-up with qtc, no actual effect on qmake itself.
Fixes: QTCREATORBUG-21416
Change-Id: I75e5634e11b10056d6dbb6fdceef482ca2222ca1
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from qtcreator/5f79b5d2e5e33321cdcd00362f0d6d9442a73ec2)
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/library/qmakevfs.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/qmake/library/qmakevfs.cpp b/qmake/library/qmakevfs.cpp index 9fd6ae470c..1f77595535 100644 --- a/qmake/library/qmakevfs.cpp +++ b/qmake/library/qmakevfs.cpp @@ -109,10 +109,10 @@ int QMakeVfs::idForFileName(const QString &fn, VfsFlags flags) return id; } #endif - if (!(flags & VfsAccessedOnly)) { #ifdef PROPARSER_THREAD_SAFE - QMutexLocker locker(&s_mutex); + QMutexLocker locker(&s_mutex); #endif + if (!(flags & VfsAccessedOnly)) { int &id = s_fileIdMap[fn]; if (!id) { id = ++s_fileIdCounter; |