ClangCodeModel: prevent accessing nullptr

There is a certain amount of time between resetting the processor to
nullptr in ClangdFollowSymbol::VirtualFunctionAssistProcessor::cancel
and the destruction of the ClangdFollowSymbol sentinel. So we also need
to check the processor before calling update.

Task-number: QTCREATORBUG-28769
Change-Id: Idec7c9dd7648285ecf2360c309d9751303f6209c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
David Schulz
2023-02-07 09:08:23 +01:00
parent 516fce6f53
commit 2293488536

View File

@@ -453,7 +453,7 @@ void ClangdFollowSymbol::Private::handleGotoImplementationResult(
const QString &name, const QString &prefix, const MessageId &reqId) {
qCDebug(clangdLog) << "handling symbol info reply"
<< link.targetFilePath.toUserOutput() << link.targetLine;
if (!sentinel)
if (!sentinel || !virtualFuncAssistProcessor)
return;
if (!name.isEmpty())
symbolsToDisplay.push_back({prefix + name, link});