summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@theqtcompany.com>2014-11-06 14:58:17 +0100
committerEike Ziller <eike.ziller@theqtcompany.com>2014-11-07 10:18:47 +0100
commitdcfd75a1bb765b8c54d6bf31483160ad64115e95 (patch)
tree3c34e8bc52b213c7291b926ed87001ba968334a4
parentd14e2b48205157b6776b82af18adfb2dd0050286 (diff)
downloadqttools-dcfd75a1bb765b8c54d6bf31483160ad64115e95.tar.gz
QHelpContentModel: Fix that the model sometimes ended up empty
When aborting collecting the content items, sometimes the "abort" state was not cleaned up correctly, so the next run thought it was aborted too. If that happened at the end of the multiple start/abort cycles that happen at initialization, the content model ended up empty. Task-number: QTCREATORBUG-13233 Change-Id: Ia47a6b033cc3fd1f7a02d5194fb6f7ea68a435c5 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
-rw-r--r--src/assistant/help/qhelpcontentwidget.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/assistant/help/qhelpcontentwidget.cpp b/src/assistant/help/qhelpcontentwidget.cpp
index 8f38bcfd3..1deaaf95a 100644
--- a/src/assistant/help/qhelpcontentwidget.cpp
+++ b/src/assistant/help/qhelpcontentwidget.cpp
@@ -219,6 +219,11 @@ void QHelpContentProvider::stopCollecting()
m_abort = true;
m_mutex.unlock();
wait();
+ // we need to force-set m_abort to false, because the thread might either have
+ // finished between the isRunning() check and the "m_abort = true" above, or the
+ // isRunning() check might already happen after the "m_abort = false" in the run() method,
+ // either way never resetting m_abort to false from within the run() method
+ m_abort = false;
}
qDeleteAll(m_rootItems);
m_rootItems.clear();