LanguageClient: guard client access in formatter

Change-Id: I76bd41b3a786b1893bc159e0363f90494fd14b9f
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
David Schulz
2022-09-27 13:12:20 +02:00
parent 99589a7572
commit 2710e68610
2 changed files with 7 additions and 4 deletions

View File

@@ -7,6 +7,8 @@
#include <texteditor/formatter.h>
#include <QPointer>
namespace TextEditor { class TextDocument; }
namespace LanguageClient {
@@ -26,7 +28,7 @@ private:
void handleResponse(
const LanguageServerProtocol::DocumentRangeFormattingRequest::Response &response);
Client *m_client = nullptr; // not owned
QPointer<Client> m_client = nullptr; // not owned
QMetaObject::Connection m_cancelConnection;
TextEditor::TextDocument *m_document; // not owned
bool m_ignoreCancel = false;