mirror of
https://github.com/Microsoft/vscode
synced 2024-10-30 11:10:48 +00:00
Add missing disposals (#155976)
* Add missing disposals I did some V8 heap profiling and found a few more places where references to closed terminals prevents them from being garbage collected. * Let closed terminals be garbage collected Action bars are not disposed when a terminal is closed, they are cached in the list until you open a new terminal, so manually clear it to make it possible to garbage collect the closed terminal directly.
This commit is contained in:
parent
ac4d678fb9
commit
c4141cf1cb
3 changed files with 8 additions and 6 deletions
|
@ -537,7 +537,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
|||
this._labelComputer?.refreshLabel();
|
||||
}
|
||||
}));
|
||||
this._workspaceContextService.onDidChangeWorkspaceFolders(() => this._labelComputer?.refreshLabel());
|
||||
this.addDisposable(this._workspaceContextService.onDidChangeWorkspaceFolders(() => this._labelComputer?.refreshLabel()));
|
||||
|
||||
// Clear out initial data events after 10 seconds, hopefully extension hosts are up and
|
||||
// running at that point.
|
||||
|
@ -760,11 +760,11 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
|||
|
||||
this._loadTypeAheadAddon(xterm);
|
||||
|
||||
this._configurationService.onDidChangeConfiguration(e => {
|
||||
this.addDisposable(this._configurationService.onDidChangeConfiguration(e => {
|
||||
if (e.affectsConfiguration(TerminalSettingId.LocalEchoEnabled)) {
|
||||
this._loadTypeAheadAddon(xterm);
|
||||
}
|
||||
});
|
||||
}));
|
||||
|
||||
this._pathService.userHome().then(userHome => {
|
||||
this._userHome = userHome.fsPath;
|
||||
|
|
|
@ -458,12 +458,14 @@ class TerminalTabsRenderer implements IListRenderer<ITerminalInstance, ITerminal
|
|||
disposeElement(instance: ITerminalInstance, index: number, templateData: ITerminalTabEntryTemplate): void {
|
||||
templateData.elementDisposables?.dispose();
|
||||
templateData.elementDisposables = undefined;
|
||||
templateData.actionBar.clear();
|
||||
}
|
||||
|
||||
disposeTemplate(templateData: ITerminalTabEntryTemplate): void {
|
||||
templateData.elementDisposables?.dispose();
|
||||
templateData.elementDisposables = undefined;
|
||||
templateData.label.dispose();
|
||||
templateData.actionBar.clear();
|
||||
}
|
||||
|
||||
fillActionBar(instance: ITerminalInstance, template: ITerminalTabEntryTemplate): void {
|
||||
|
|
|
@ -76,7 +76,7 @@ export class DecorationAddon extends Disposable implements ITerminalAddon {
|
|||
this._register(this._contextMenuService.onDidHideContextMenu(() => this._contextMenuVisible = false));
|
||||
this._hoverDelayer = this._register(new Delayer(this._configurationService.getValue('workbench.hover.delay')));
|
||||
|
||||
this._configurationService.onDidChangeConfiguration(e => {
|
||||
this._register(this._configurationService.onDidChangeConfiguration(e => {
|
||||
if (e.affectsConfiguration(TerminalSettingId.ShellIntegrationDecorationIcon) ||
|
||||
e.affectsConfiguration(TerminalSettingId.ShellIntegrationDecorationIconSuccess) ||
|
||||
e.affectsConfiguration(TerminalSettingId.ShellIntegrationDecorationIconError)) {
|
||||
|
@ -92,8 +92,8 @@ export class DecorationAddon extends Disposable implements ITerminalAddon {
|
|||
}
|
||||
this._updateDecorationVisibility();
|
||||
}
|
||||
});
|
||||
this._themeService.onDidColorThemeChange(() => this._refreshStyles(true));
|
||||
}));
|
||||
this._register(this._themeService.onDidColorThemeChange(() => this._refreshStyles(true)));
|
||||
this._updateDecorationVisibility();
|
||||
this._register(this._capabilities.onDidAddCapability(c => {
|
||||
if (c === TerminalCapability.CommandDetection) {
|
||||
|
|
Loading…
Reference in a new issue