Skip to content

Commit c838b56

Browse files
authored
notebook sticky line memory-leaks (microsoft#189084)
nb memory-leaks
1 parent 56614fb commit c838b56

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineProvider.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ export class NotebookCellOutlineProvider {
184184
}
185185

186186
dispose(): void {
187-
// selectionListener.clear();
187+
this._entries.length = 0;
188+
this._activeEntry = undefined;
188189
this._entriesDisposables.dispose();
189190
this._dispoables.dispose();
190191
}

src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ class NotebookStickyLine extends Disposable {
5555
public readonly notebookEditor: INotebookEditor,
5656
) {
5757
super();
58-
this._register(DOM.addDisposableListener(this.element, DOM.EventType.CLICK, (e) => {
59-
console.log('click on sticky line');
58+
this._register(DOM.addDisposableListener(this.element, DOM.EventType.CLICK, () => {
6059
this.focusCell();
6160
}));
6261
}
@@ -78,7 +77,6 @@ class NotebookStickyLine extends Disposable {
7877
}
7978
return count;
8079
}
81-
8280
}
8381

8482

@@ -134,6 +132,9 @@ export class NotebookStickyScroll extends Disposable {
134132
this.init();
135133
} else {
136134
this._disposables.clear();
135+
this.currentStickyLines.forEach((value) => {
136+
value.dispose();
137+
});
137138
DOM.clearNode(this.domNode);
138139
this.updateDisplay();
139140
}
@@ -444,6 +445,9 @@ export class NotebookStickyScroll extends Disposable {
444445

445446
override dispose() {
446447
this._disposables.dispose();
448+
this.currentStickyLines.forEach((value) => {
449+
value.dispose();
450+
});
447451
super.dispose();
448452
}
449453
}

0 commit comments

Comments
 (0)