notebook sticky line memory-leaks (#189084)

nb memory-leaks
This commit is contained in:
Michael Lively
2023-07-27 11:26:19 -07:00
committed by GitHub
parent 56614fbaa0
commit c838b56b6c
2 changed files with 9 additions and 4 deletions
@@ -184,7 +184,8 @@ export class NotebookCellOutlineProvider {
}
dispose(): void {
// selectionListener.clear();
this._entries.length = 0;
this._activeEntry = undefined;
this._entriesDisposables.dispose();
this._dispoables.dispose();
}
@@ -55,8 +55,7 @@ class NotebookStickyLine extends Disposable {
public readonly notebookEditor: INotebookEditor,
) {
super();
this._register(DOM.addDisposableListener(this.element, DOM.EventType.CLICK, (e) => {
console.log('click on sticky line');
this._register(DOM.addDisposableListener(this.element, DOM.EventType.CLICK, () => {
this.focusCell();
}));
}
@@ -78,7 +77,6 @@ class NotebookStickyLine extends Disposable {
}
return count;
}
}
@@ -134,6 +132,9 @@ export class NotebookStickyScroll extends Disposable {
this.init();
} else {
this._disposables.clear();
this.currentStickyLines.forEach((value) => {
value.dispose();
});
DOM.clearNode(this.domNode);
this.updateDisplay();
}
@@ -444,6 +445,9 @@ export class NotebookStickyScroll extends Disposable {
override dispose() {
this._disposables.dispose();
this.currentStickyLines.forEach((value) => {
value.dispose();
});
super.dispose();
}
}