From 54da36d181b8ec74c979ebe362ec9f623bad0190 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Tue, 22 Dec 2020 17:30:43 +0100 Subject: [PATCH] proper disposing of outline objects --- .../notebook/browser/contrib/outline/notebookOutline.ts | 1 + src/vs/workbench/contrib/outline/browser/outlinePane.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.ts b/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.ts index b26cbdb7db9..fbdabb60e5c 100644 --- a/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.ts +++ b/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.ts @@ -206,6 +206,7 @@ class NotebookCellOutline implements IOutline { dispose(): void { this._dispoables.dispose(); + this._entriesDisposables.dispose(); } private _recomputeState(): void { diff --git a/src/vs/workbench/contrib/outline/browser/outlinePane.ts b/src/vs/workbench/contrib/outline/browser/outlinePane.ts index ede40349c01..6873dc62bf7 100644 --- a/src/vs/workbench/contrib/outline/browser/outlinePane.ts +++ b/src/vs/workbench/contrib/outline/browser/outlinePane.ts @@ -123,6 +123,8 @@ export class OutlinePane extends ViewPane { if (!visible) { // stop everything when not visible this._editorListener.clear(); + this._editorDisposables.clear(); + } else if (!this._editorListener.value) { this._editorListener.value = Event.any(this._editorService.onDidActiveEditorChange, this._outlineService.onDidChange)(() => { this._handleEditorChanged(this._editorService.activeEditorPane); @@ -201,6 +203,7 @@ export class OutlinePane extends ViewPane { return; } + this._editorDisposables.add(newOutline); this._progressBar.stop().hide(); const tree = , any, FuzzyScore>>this._instantiationService.createInstance( -- GitLab