Skip to content

Commit d400e33

Browse files
authored
Merge pull request #5837 from bnbarham/temp-lsp-fix
[clangd] Wait for stdlib indexing to finish before destroying the index
2 parents 4b1b457 + 7a268b8 commit d400e33

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clang-tools-extra/clangd/ClangdServer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,9 @@ ClangdServer::ClangdServer(const GlobalCompilationDatabase &CDB,
233233
}
234234

235235
ClangdServer::~ClangdServer() {
236+
// Wait for stdlib indexing to finish.
237+
if (IndexTasks)
238+
IndexTasks->wait();
236239
// Destroying TUScheduler first shuts down request threads that might
237240
// otherwise access members concurrently.
238241
// (Nobody can be using TUScheduler because we're on the main thread).

0 commit comments

Comments
 (0)