forked from qt-creator/qt-creator
Copilot: shutdown plugin asynchronously
Wait for the client to finish. This fixes a crash when running the plugin unit tests of the copilot plugin. Change-Id: Id0805cb628a79316cd904350bb159ff1369a03b9 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -60,5 +60,13 @@ void CopilotPlugin::restartClient()
|
||||
CopilotSettings::instance().distPath());
|
||||
}
|
||||
|
||||
ExtensionSystem::IPlugin::ShutdownFlag CopilotPlugin::aboutToShutdown()
|
||||
{
|
||||
if (!m_client)
|
||||
return SynchronousShutdown;
|
||||
connect(m_client, &QObject::destroyed, this, &IPlugin::asynchronousShutdownFinished);
|
||||
return AsynchronousShutdown;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Copilot
|
||||
|
||||
Reference in New Issue
Block a user