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:
@@ -84,7 +84,7 @@ public:
|
||||
|
||||
typedef std::shared_ptr<SwiftASTConsumer> SwiftASTConsumerRef;
|
||||
|
||||
class SwiftASTManager {
|
||||
class SwiftASTManager : public std::enable_shared_from_this<SwiftASTManager> {
|
||||
public:
|
||||
explicit SwiftASTManager(SwiftLangSupport &LangSupport);
|
||||
~SwiftASTManager();
|
||||
@@ -131,8 +131,6 @@ public:
|
||||
void removeCachedAST(SwiftInvocationRef Invok);
|
||||
|
||||
struct Implementation;
|
||||
|
||||
private:
|
||||
Implementation &Impl;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user