timeline: fix memory leak when toggling pane visibility (#304668)

* timeline: dispose previous visibility subscriptions before recreating

* retrigger CI

---------

Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>
This commit is contained in:
xingsy97
2026-03-27 14:10:14 +08:00
committed by GitHub
parent 3bafa7dc2a
commit befae3eaff

View File

@@ -883,6 +883,7 @@ export class TimelinePane extends ViewPane {
override setVisible(visible: boolean): void {
if (visible) {
this.extensionService.activateByEvent('onView:timeline');
this.visibilityDisposables?.dispose();
this.visibilityDisposables = new DisposableStore();
this.editorService.onDidActiveEditorChange(this.onActiveEditorChanged, this, this.visibilityDisposables);