forked from qt-creator/qt-creator
Help: Don't crash on shutdown when (un)registedDocumentationNow()
Put the future into the future synchronizer. Otherwise, when (un)registedDocumentationNow() is still executed on shutdown we are destroying the locked mutex and crash. Change-Id: Ic8e7f8252719a3015101a0f5fc7b48ba57956562 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/progressmanager/progressmanager.h>
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/async.h>
|
||||
#include <utils/filesystemwatcher.h>
|
||||
@@ -138,6 +140,7 @@ void HelpManager::registerDocumentation(const QStringList &files)
|
||||
}
|
||||
|
||||
QFuture<bool> future = Utils::asyncRun(®isterDocumentationNow, collectionFilePath(), files);
|
||||
ExtensionSystem::PluginManager::futureSynchronizer()->addFuture(future);
|
||||
Utils::onResultReady(future, this, [](bool docsChanged){
|
||||
if (docsChanged) {
|
||||
d->m_helpEngine->setupData();
|
||||
@@ -200,6 +203,7 @@ void HelpManager::unregisterDocumentation(const QStringList &files)
|
||||
|
||||
d->m_userRegisteredFiles.subtract(Utils::toSet(files));
|
||||
QFuture<bool> future = Utils::asyncRun(&unregisterDocumentationNow, collectionFilePath(), files);
|
||||
ExtensionSystem::PluginManager::futureSynchronizer()->addFuture(future);
|
||||
Utils::onResultReady(future, this, [](bool docsChanged){
|
||||
if (docsChanged) {
|
||||
d->m_helpEngine->setupData();
|
||||
|
Reference in New Issue
Block a user