From c057a4b9c73ce820e0c1a02797bf9f06bd638e86 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 1 Oct 2019 17:09:46 -0700 Subject: [PATCH] Make sure we dispose of any custom editor inputs when replacing them Fixes #81773 --- .../workbench/contrib/customEditor/browser/customEditors.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/vs/workbench/contrib/customEditor/browser/customEditors.ts b/src/vs/workbench/contrib/customEditor/browser/customEditors.ts index 20930bf6242..21a77e1b3a1 100644 --- a/src/vs/workbench/contrib/customEditor/browser/customEditors.ts +++ b/src/vs/workbench/contrib/customEditor/browser/customEditors.ts @@ -179,6 +179,12 @@ export class CustomEditorService implements ICustomEditorService { replacement: input, options: options ? EditorOptions.create(options) : undefined, }], group); + + for (const editor of existingEditors) { + if (editor instanceof CustomFileEditorInput) { + editor.dispose(); + } + } } } return this.editorService.openEditor(input, options, group); -- GitLab