Locator: Do not block main event loop

There are multiple locator filters (SpotlightLocatorFilter,
JavaScriptFilter, HelpIndexFilter, the LanguageClient filters) that
depend on the main event loop, and might lock up if that does not run
anymore.

So we cannot use waitForFinished. Cancel a running locator search, and
tell the plugin manager that we need to wait for asynchronous events to
finish before shutting down.

Amends cb5977fbad

Change-Id: Id0b3dc75bc22f21b34be39c3bdbec915b60bdee6
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
Eike Ziller
2021-02-10 13:17:54 +01:00
parent 845dee5895
commit 7c0c98a438
5 changed files with 38 additions and 16 deletions

View File

@@ -443,7 +443,8 @@ QString CorePlugin::msgCrashpadInformation()
ExtensionSystem::IPlugin::ShutdownFlag CorePlugin::aboutToShutdown()
{
Find::aboutToShutdown();
m_locator->aboutToShutdown();
ExtensionSystem::IPlugin::ShutdownFlag shutdownFlag = m_locator->aboutToShutdown(
[this] { emit asynchronousShutdownFinished(); });
m_mainWindow->aboutToShutdown();
return SynchronousShutdown;
return shutdownFlag;
}