Skip to content

Commit d634838

Browse files
authored
Dispose of rendered markdown properly (microsoft#163944)
1 parent 1fb956d commit d634838

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/vs/workbench/contrib/scm/browser/scmViewPane.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2132,7 +2132,8 @@ class SCMInputWidget {
21322132
this.contextViewService.hideContextView();
21332133
}));
21342134

2135-
const { element: mdElement } = this.instantiationService.createInstance(MarkdownRenderer, {}).render(message, {
2135+
const renderer = disposables.add(this.instantiationService.createInstance(MarkdownRenderer, {}));
2136+
const renderedMarkdown = renderer.render(message, {
21362137
actionHandler: {
21372138
callback: (content) => {
21382139
this.openerService.open(content, { allowCommands: typeof message !== 'string' && message.isTrusted });
@@ -2141,7 +2142,8 @@ class SCMInputWidget {
21412142
disposables: disposables
21422143
},
21432144
});
2144-
element.appendChild(mdElement);
2145+
disposables.add(renderedMarkdown);
2146+
element.appendChild(renderedMarkdown.element);
21452147
}
21462148
const actionsContainer = append(validationContainer, $('.scm-editor-validation-actions'));
21472149
const actionbar = new ActionBar(actionsContainer);

0 commit comments

Comments
 (0)