From: Eike Ziller Date: Thu, 6 Nov 2014 13:58:17 +0000 (+0100) Subject: QHelpContentModel: Fix that the model sometimes ended up empty X-Git-Tag: v5.4.0~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dcfd75a1bb765b8c54d6bf31483160ad64115e95;p=platform%2Fupstream%2Fqttools.git 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 --- diff --git a/src/assistant/help/qhelpcontentwidget.cpp b/src/assistant/help/qhelpcontentwidget.cpp index 8f38bcf..1deaaf9 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();