Skip to content

Commit 9091513

Browse files
authored
Fix timeline not disposing of template properly (#164838)
We should dispose the entire template, not just the `iconLabel`
1 parent 0a80e31 commit 9091513

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/vs/workbench/contrib/timeline/browser/timelinePane.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ export class TimelinePane extends ViewPane {
10431043
}
10441044
}
10451045

1046-
export class TimelineElementTemplate implements IDisposable {
1046+
class TimelineElementTemplate implements IDisposable {
10471047
static readonly id = 'TimelineElementTemplate';
10481048

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

10541054
constructor(
1055-
readonly container: HTMLElement,
1055+
container: HTMLElement,
10561056
actionViewItemProvider: IActionViewItemProvider,
1057-
private hoverDelegate: IHoverDelegate,
1058-
1057+
hoverDelegate: IHoverDelegate,
10591058
) {
10601059
container.classList.add('custom-view-tree-node-item');
10611060
this.icon = DOM.append(container, DOM.$('.custom-view-tree-node-item-icon'));
10621061

1063-
this.iconLabel = new IconLabel(container, { supportHighlights: true, supportIcons: true, hoverDelegate: this.hoverDelegate });
1062+
this.iconLabel = new IconLabel(container, { supportHighlights: true, supportIcons: true, hoverDelegate: hoverDelegate });
10641063

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

12151214
disposeTemplate(template: TimelineElementTemplate): void {
1216-
template.iconLabel.dispose();
1215+
template.dispose();
12171216
}
12181217
}
12191218

0 commit comments

Comments
 (0)