diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2021-05-12 16:55:32 +0200 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2021-05-12 22:09:03 +0000 |
commit | da27ac457f524bc96788228461e62e1ef2eaaab7 (patch) | |
tree | f49040fa034a3bc02cf675ca9294575a91adea66 /src/plugins/help | |
parent | 91f136ef3ab75471cabcaed9dc16dad9f504add8 (diff) |
Do QFutureWatcher::setFuture() after connecting to watcher's signals
Otherwise we may have race condition.
Reference: documentation for QFutureWatcher::setFuture()
and the implementation of
QFutureInterfaceBasePrivate::connectOutputInterface(
QFutureCallOutInterface *interface).
Change-Id: I5b483baaf1b844871a162f47ce7683e9ff495acb
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/help')
-rw-r--r-- | src/plugins/help/searchwidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/help/searchwidget.cpp b/src/plugins/help/searchwidget.cpp index cb2db9f76da..99793d41114 100644 --- a/src/plugins/help/searchwidget.cpp +++ b/src/plugins/help/searchwidget.cpp @@ -185,9 +185,9 @@ void SearchWidget::indexingStarted() m_progress->setProgressValueAndText(1, tr("Indexing Documentation")); m_progress->reportStarted(); - m_watcher.setFuture(m_progress->future()); connect(&m_watcher, &QFutureWatcherBase::canceled, searchEngine, &QHelpSearchEngine::cancelIndexing); + m_watcher.setFuture(m_progress->future()); m_queryWidget->hide(); m_indexingDocumentationLabel->show(); |