diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-10-01 17:11:53 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-02 03:15:09 +0200 |
commit | d14abab0d3c4d51077f9169f4a09ba3202eaa4a7 (patch) | |
tree | d946af9dbe6c5939b121bb4532505f22f443f281 | |
parent | c74f60b09dc031b19ebfa11718d44fb06a5569b2 (diff) |
Fix race condition in ~QFileInfoGatherer
tst_qfilesystemmodel was hanging regularly. In
QFileInfoGatherer::~QFileInfoGatherer() it would be stuck on wait() and
in QFileInfoGatherer::run() it would be at condition.wait(&mutex);
It looks like while abort was set to true, the while in run() had just
entered so that it would wait for condition indefinitely.
Task-number: QTBUG-29403
Change-Id: If6cebbc98ec7f54fbdf347804780bbfc5e177b3b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
-rw-r--r-- | src/widgets/dialogs/qfileinfogatherer.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/widgets/dialogs/qfileinfogatherer.cpp b/src/widgets/dialogs/qfileinfogatherer.cpp index 0f12c2b80e..c06ef0c474 100644 --- a/src/widgets/dialogs/qfileinfogatherer.cpp +++ b/src/widgets/dialogs/qfileinfogatherer.cpp @@ -94,7 +94,9 @@ QFileInfoGatherer::QFileInfoGatherer(QObject *parent) QFileInfoGatherer::~QFileInfoGatherer() { abort.store(true); + QMutexLocker locker(&mutex); condition.wakeAll(); + locker.unlock(); wait(); } |