提交 c8e14b5a 编写于 作者: R Rob Lourens

Fix #50555 - fix settings editor memory leak

上级 69ccf524
......@@ -1373,6 +1373,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
this._onWillDispose.fire();
this.titleAreaControl.dispose();
// this.editorControl = null;
super.dispose();
}
......
......@@ -225,10 +225,10 @@ export class SettingsEditor2 extends BaseEditor {
private createHeaderControls(parent: HTMLElement): void {
const headerControlsContainerRight = DOM.append(parent, $('.settings-header-controls-right'));
this.toolbar = new ToolBar(headerControlsContainerRight, this.contextMenuService, {
this.toolbar = this._register(new ToolBar(headerControlsContainerRight, this.contextMenuService, {
ariaLabel: localize('settingsToolbarLabel', "Settings Editor Actions"),
actionRunner: this.actionRunner
});
}));
const actions: Action[] = [
this.instantiationService.createInstance(FilterByTagAction,
......@@ -290,11 +290,11 @@ export class SettingsEditor2 extends BaseEditor {
const tocRenderer = this.instantiationService.createInstance(TOCRenderer);
this.tocTree = this.instantiationService.createInstance(TOCTree, this.tocTreeContainer,
this.tocTree = this._register(this.instantiationService.createInstance(TOCTree, this.tocTreeContainer,
this.viewState,
{
renderer: tocRenderer
});
}));
this._register(this.tocTree.onDidChangeFocus(e => {
// Let the caller finish before trying to sync with settings tree.
......@@ -345,12 +345,12 @@ export class SettingsEditor2 extends BaseEditor {
}));
this._register(renderer.onDidClickSettingLink(settingName => this.revealSetting(settingName)));
this.settingsTree = this.instantiationService.createInstance(SettingsTree,
this.settingsTree = this._register(this.instantiationService.createInstance(SettingsTree,
this.settingsTreeContainer,
this.viewState,
{
renderer
});
}));
this._register(this.settingsTree.onDidChangeFocus(e => {
this.settingsTree.setSelection([e.focus], e.payload);
......
......@@ -1462,9 +1462,10 @@ export class SettingsTree extends NonExpandableTree {
) {
const treeClass = 'settings-editor-tree';
const controller = instantiationService.createInstance(SettingsTreeController);
const fullConfiguration = <ITreeConfiguration>{
dataSource: instantiationService.createInstance(SettingsDataSource, viewState),
controller: instantiationService.createInstance(SettingsTreeController),
controller,
accessibilityProvider: instantiationService.createInstance(SettingsAccessibilityProvider),
filter: instantiationService.createInstance(SettingsTreeFilter, viewState),
styler: new DefaultTreestyler(DOM.createStyleSheet(), treeClass),
......@@ -1488,6 +1489,8 @@ export class SettingsTree extends NonExpandableTree {
instantiationService,
configurationService);
this.disposables.push(controller);
this.disposables.push(registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
const activeBorderColor = theme.getColor(focusBorder);
if (activeBorderColor) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册