[PATCH] D66881: [clangd][vscode] Don't leak the resources

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 28 06:56:48 PDT 2019


hokein created this revision.
hokein added a reviewer: jvikstrom.
Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ilya-biryukov.
Herald added a project: clang.

We miss a few places where we need to add them to the subscriptions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D66881

Files:
  clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts


Index: clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts
===================================================================
--- clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts
+++ clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts
@@ -133,9 +133,10 @@
         vscode.window.showTextDocument(doc);
       }));
   const status = new FileStatus();
+  context.subscriptions.push(vscode.Disposable.from(status));
   context.subscriptions.push(vscode.window.onDidChangeActiveTextEditor(
       () => { status.updateStatus(); }));
-  clangdClient.onDidChangeState(({newState}) => {
+  context.subscriptions.push(clangdClient.onDidChangeState(({ newState }) => {
     if (newState == vscodelc.State.Running) {
       // clangd starts or restarts after crash.
       clangdClient.onNotification(
@@ -150,7 +151,7 @@
       status.clear();
       semanticHighlightingFeature.dispose();
     }
-  })
+  }));
   // An empty place holder for the activate command, otherwise we'll get an
   // "command is not registered" error.
   context.subscriptions.push(vscode.commands.registerCommand(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66881.217637.patch
Type: text/x-patch
Size: 1123 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190828/a3c0b6f8/attachment.bin>


More information about the cfe-commits mailing list