mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[sourcekit] Use a shared_ptr for the SwiftASTManager
When the server shuts down we may still have outstanding async work to build an AST, so use a shared_ptr + weak_ptr instead of unique_ptr + unowned references.
This commit is contained in:
@@ -178,7 +178,7 @@ SwiftLangSupport::SwiftLangSupport(SourceKit::Context &SKCtx)
|
||||
llvm::sys::path::append(LibPath, "swift");
|
||||
RuntimeResourcePath = LibPath.str();
|
||||
|
||||
ASTMgr.reset(new SwiftASTManager(*this));
|
||||
ASTMgr = std::make_shared<SwiftASTManager>(*this);
|
||||
// By default, just use the in-memory cache.
|
||||
CCCache->inMemory = llvm::make_unique<ide::CodeCompletionCache>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user