Skip to content

Commit 7a268b8

Browse files
committed
[clangd] Wait for stdlib indexing to finish before destroying the index
This will need to be fixed upstream, but temporarily fix on stable/20221013 to get LSP tests passing.
1 parent 2811ab6 commit 7a268b8

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)