Fix a couple of bugs related with use-after-free. Try to make some of the text document and syntax highlighter functionality more thread-safe.

This commit is contained in:
Martín Lucas Golini
2025-08-10 01:25:10 -03:00
parent 61c3e72289
commit cec73de2eb
26 changed files with 469 additions and 220 deletions

View File

@@ -1655,6 +1655,15 @@ bool LSPClientServer::hasDocument( const URI& uri ) const {
return false;
}
bool LSPClientServer::hasDocumentClient( LSPDocumentClient* cl ) const {
Lock l( mClientsMutex );
for ( const auto& client : mClients ) {
if ( client.second && client.second.get() == cl )
return true;
}
return false;
}
bool LSPClientServer::hasDocuments() const {
return !mDocs.empty();
}