mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 19:18:59 +01:00
Adopt IEventEmitter.addListener2
This commit is contained in:
@@ -155,9 +155,9 @@ export class ResourceEditorInput extends EditorInput {
|
||||
// Otherwise Create Model and handle dispose event
|
||||
return ResourceEditorInput.getOrCreateModel(this.modelService, this.resource).then(() => {
|
||||
let model = this.instantiationService.createInstance(ResourceEditorModel, this.resource);
|
||||
const unbind = model.addListener(EventType.DISPOSE, () => {
|
||||
const unbind = model.addListener2(EventType.DISPOSE, () => {
|
||||
this.cachedModel = null; // make sure we do not dispose model again
|
||||
unbind();
|
||||
unbind.dispose();
|
||||
this.dispose();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user