LanguageClient: prevent updating closed document

Remove the closed document from the container that tracks document
modifications to prevent accessing a deleted document.

Change-Id: Iafba8ad3ce054761017a8feca28fdc4c8b379ef6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
David Schulz
2022-08-01 10:37:25 +02:00
parent 2356e9314c
commit 80aa0fe1fd

View File

@@ -647,6 +647,7 @@ void Client::closeDocument(TextEditor::TextDocument *document)
{
deactivateDocument(document);
d->m_postponedDocuments.remove(document);
d->m_documentsToUpdate.erase(document);
if (d->m_openedDocument.remove(document) != 0) {
handleDocumentClosed(document);
if (d->m_state == Initialized)