forked from qt-creator/qt-creator
ClangdClient: Fix possible crash
Fixes: QTCREATORBUG-26018 Change-Id: Ib93d6067950b548f6d437bb06cc9f11a8246e105 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -787,13 +787,15 @@ ClangdClient::ClangdClient(Project *project, const Utils::FilePath &jsonDbDir)
|
|||||||
gatherHelpItemForTooltip(response, uri);
|
gatherHelpItemForTooltip(response, uri);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(this, &Client::workDone, this, [this, project](const ProgressToken &token) {
|
connect(this, &Client::workDone, this,
|
||||||
|
[this, p = QPointer(project)](const ProgressToken &token) {
|
||||||
const QString * const val = Utils::get_if<QString>(&token);
|
const QString * const val = Utils::get_if<QString>(&token);
|
||||||
if (val && *val == indexingToken()) {
|
if (val && *val == indexingToken()) {
|
||||||
d->isFullyIndexed = true;
|
d->isFullyIndexed = true;
|
||||||
emit indexingFinished();
|
emit indexingFinished();
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
emit project->indexingFinished("Indexer.Clangd");
|
if (p)
|
||||||
|
emit p->indexingFinished("Indexer.Clangd");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user