Skip to content

Commit

Permalink
Fix timeline not disposing of template properly (#164838)
Browse files Browse the repository at this point in the history
We should dispose the entire template, not just the `iconLabel`
  • Loading branch information
mjbvz authored Oct 28, 2022
1 parent 0a80e31 commit 9091513
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/vs/workbench/contrib/timeline/browser/timelinePane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ export class TimelinePane extends ViewPane {
}
}

export class TimelineElementTemplate implements IDisposable {
class TimelineElementTemplate implements IDisposable {
static readonly id = 'TimelineElementTemplate';

readonly actionBar: ActionBar;
Expand All @@ -1052,15 +1052,14 @@ export class TimelineElementTemplate implements IDisposable {
readonly timestamp: HTMLSpanElement;

constructor(
readonly container: HTMLElement,
container: HTMLElement,
actionViewItemProvider: IActionViewItemProvider,
private hoverDelegate: IHoverDelegate,

hoverDelegate: IHoverDelegate,
) {
container.classList.add('custom-view-tree-node-item');
this.icon = DOM.append(container, DOM.$('.custom-view-tree-node-item-icon'));

this.iconLabel = new IconLabel(container, { supportHighlights: true, supportIcons: true, hoverDelegate: this.hoverDelegate });
this.iconLabel = new IconLabel(container, { supportHighlights: true, supportIcons: true, hoverDelegate: hoverDelegate });

const timestampContainer = DOM.append(this.iconLabel.element, DOM.$('.timeline-timestamp-container'));
this.timestamp = DOM.append(timestampContainer, DOM.$('span.timeline-timestamp'));
Expand Down Expand Up @@ -1213,7 +1212,7 @@ class TimelineTreeRenderer implements ITreeRenderer<TreeElement, FuzzyScore, Tim
}

disposeTemplate(template: TimelineElementTemplate): void {
template.iconLabel.dispose();
template.dispose();
}
}

Expand Down

0 comments on commit 9091513

Please sign in to comment.