Adopt IEventEmitter.addListener2

This commit is contained in:
Alex Dima
2016-05-21 10:37:27 +02:00
parent b9b39fd2ae
commit c63203bf80
74 changed files with 405 additions and 556 deletions

View File

@@ -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();
});