ClangCodeModel: Keep a QPointer to the ClangdClient in ClangdTextMark

Apparently, the pointer might already be invalid when
addToolTipContent() is called.

Change-Id: I649bdca0945247b2b8ce4f709721c4d0bf96a11b
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2021-06-30 13:15:41 +02:00
parent 6a142dfd95
commit f9083cc6ad
2 changed files with 4 additions and 3 deletions

View File

@@ -32,6 +32,8 @@
#include <texteditor/textmark.h>
#include <QPointer>
#include <functional>
namespace LanguageClient { class Client; }
@@ -77,7 +79,7 @@ private:
const LanguageServerProtocol::Diagnostic m_lspDiagnostic;
const ClangBackEnd::DiagnosticContainer m_diagnostic;
const LanguageClient::Client * const m_client;
const QPointer<const LanguageClient::Client> m_client;
};
} // namespace Internal