LanguageClient: Fix crashed client restart condition

Change-Id: I4b0195a512b6b1dcbcc6fd02f6014a27b4606ea0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2023-10-20 10:53:59 +02:00
parent 5f45c36b6f
commit a18ea390e1
5 changed files with 8 additions and 2 deletions

View File

@@ -172,7 +172,8 @@ void LanguageClientManager::clientFinished(Client *client)
= managerInstance->m_clientForDocument.keys(client);
if (unexpectedFinish) {
if (!PluginManager::isShuttingDown()) {
if (client->state() == Client::Initialized && client->reset()) {
const bool shouldRestart = client->state() > Client::FailedToInitialize;
if (shouldRestart && client->reset()) {
qCDebug(Log) << "restart unexpectedly finished client: " << client->name() << client;
client->log(
Tr::tr("Unexpectedly finished. Restarting in %1 seconds.").arg(restartTimeoutS));