diff options
author | Joona Petrell <joona.t.petrell@nokia.com> | 2010-09-17 04:47:20 (GMT) |
---|---|---|
committer | Joona Petrell <joona.t.petrell@nokia.com> | 2010-09-17 05:03:35 (GMT) |
commit | 0c971a9801766a6d7646d1c1c413354f74db41e4 (patch) | |
tree | d7add0c26bdd094e7339cd9a6fbd4a6712006bb5 | |
parent | a4cadd1b1fd30a1989d56f6c06deb8fed4f79882 (diff) | |
download | Qt-0c971a9801766a6d7646d1c1c413354f74db41e4.zip Qt-0c971a9801766a6d7646d1c1c413354f74db41e4.tar.gz Qt-0c971a9801766a6d7646d1c1c413354f74db41e4.tar.bz2 |
Fix QDeclarativeXmlQuery mutex locking and don't wait for new jobs if the query has already quit
Task-number: QTBUG-13041
Reviewed-by: Aaron Kennedy
-rw-r--r-- | src/declarative/util/qdeclarativexmllistmodel.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp index 47b502d..f0ed80b 100644 --- a/src/declarative/util/qdeclarativexmllistmodel.cpp +++ b/src/declarative/util/qdeclarativexmllistmodel.cpp @@ -209,8 +209,9 @@ Q_SIGNALS: protected: void run() { + m_mutex.lock(); + while (!m_quit) { - m_mutex.lock(); if (!m_jobs.isEmpty()) m_currentJob = m_jobs.dequeue(); m_mutex.unlock(); @@ -230,12 +231,13 @@ protected: m_mutex.lock(); if (m_currentJob.queryId != -1 && m_abortQueryId != m_currentJob.queryId) emit queryCompleted(r); - if (m_jobs.isEmpty()) + if (m_jobs.isEmpty() && !m_quit) m_condition.wait(&m_mutex); m_currentJob.queryId = -1; m_abortQueryId = -1; - m_mutex.unlock(); } + + m_mutex.unlock(); } private: |