mirror of
https://github.com/Microsoft/vscode
synced 2024-09-18 01:58:27 +00:00
Merge pull request #189007 from microsoft/constant-tarantula
fix memory leak
This commit is contained in:
commit
d1621baf8c
|
@ -314,6 +314,7 @@ export class NotebookCellOutline implements IOutline<OutlineEntry> {
|
|||
this._onDidChange.dispose();
|
||||
this._dispoables.dispose();
|
||||
this._entriesDisposables.dispose();
|
||||
this._outlineProvider?.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -325,7 +325,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD
|
|||
|
||||
this._register(this.instantiationService.createInstance(NotebookEditorContextKeys, this));
|
||||
|
||||
this._notebookOutline = this.instantiationService.createInstance(NotebookCellOutlineProvider, this, OutlineTarget.QuickPick);
|
||||
this._notebookOutline = this._register(this.instantiationService.createInstance(NotebookCellOutlineProvider, this, OutlineTarget.QuickPick));
|
||||
|
||||
this._register(notebookKernelService.onDidChangeSelectedNotebooks(e => {
|
||||
if (isEqual(e.notebook, this.viewModel?.uri)) {
|
||||
|
|
|
@ -185,6 +185,7 @@ export class NotebookCellOutlineProvider {
|
|||
|
||||
dispose(): void {
|
||||
// selectionListener.clear();
|
||||
this._entriesDisposables.dispose();
|
||||
this._dispoables.dispose();
|
||||
}
|
||||
|
||||
|
@ -329,6 +330,11 @@ export class NotebookCellOutlineProvider {
|
|||
};
|
||||
if (this._configurationService.getValue(OutlineConfigKeys.problemsEnabled)) {
|
||||
markerServiceListener.value = this._markerService.onMarkerChanged(e => {
|
||||
if (notebookEditorWidget.isDisposed) {
|
||||
console.error('notebook editor is disposed');
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.some(uri => notebookEditorWidget.getCellsInRange().some(cell => isEqual(cell.uri, uri)))) {
|
||||
doUpdateMarker(false);
|
||||
this._onDidChange.fire({});
|
||||
|
|
Loading…
Reference in a new issue