[sourcekit] Use a shared_ptr for the NotificationCenter

When the server shuts down we may still have outstanding async work that
can attempt to trigger a notification, so use a shared_ptr + weak_ptr
instead of unique_ptr + unowned references.
This commit is contained in:
Ben Langmuir
2018-09-18 10:13:34 -07:00
parent f3893f0cb6
commit c6776db83d
5 changed files with 9 additions and 8 deletions

View File

@@ -122,7 +122,7 @@ public:
}
void addNotificationReceiver(DocumentUpdateNotificationReceiver Receiver) {
Ctx.getNotificationCenter().addDocumentUpdateNotificationReceiver(Receiver);
Ctx.getNotificationCenter()->addDocumentUpdateNotificationReceiver(Receiver);
}
void open(const char *DocName, StringRef Text,