Make sure we dispose of CellOutputViewModel (#131146)
`CellOutputViewModel` is disposable but doesn't seem to get cleaned up currently
This commit is contained in:
parent
d374ee1910
commit
8361b4d101
|
@ -129,7 +129,7 @@ export interface IRenderOutputViaExtension {
|
|||
export type IInsetRenderOutput = IRenderPlainHtmlOutput | IRenderOutputViaExtension;
|
||||
export type IRenderOutput = IRenderMainframeOutput | IInsetRenderOutput;
|
||||
|
||||
export interface ICellOutputViewModel {
|
||||
export interface ICellOutputViewModel extends IDisposable {
|
||||
cellViewModel: IGenericCellViewModel;
|
||||
/**
|
||||
* When rendering an output, `model` should always be used as we convert legacy `text/error` output to `display_data` output under the hood.
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { dispose } from 'vs/base/common/lifecycle';
|
||||
import * as UUID from 'vs/base/common/uuid';
|
||||
import * as editorCommon from 'vs/editor/common/editorCommon';
|
||||
import { ITextModelService } from 'vs/editor/common/services/resolverService';
|
||||
|
@ -118,6 +119,7 @@ export class CodeCellViewModel extends BaseCellViewModel implements ICellViewMod
|
|||
this._onDidChangeOutputs.fire(splice);
|
||||
this._onDidRemoveOutputs.fire(removedOutputs);
|
||||
this.layoutChange({ outputHeight: true }, 'CodeCellViewModel#model.onDidChangeOutputs');
|
||||
dispose(removedOutputs);
|
||||
}));
|
||||
|
||||
this._register(this.model.onDidChangeMetadata(e => {
|
||||
|
@ -424,5 +426,6 @@ export class CodeCellViewModel extends BaseCellViewModel implements ICellViewMod
|
|||
|
||||
this._outputCollection = [];
|
||||
this._outputsTop = null;
|
||||
dispose(this._outputViewModels);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue