|
@@ -47,7 +47,12 @@ export class DiagnostcsAdapter {
|
|
|
|
|
|
const onModelRemoved = (model: monaco.editor.IModel): void => {
|
|
|
monaco.editor.setModelMarkers(model, this._languageId, []);
|
|
|
- delete this._listener[model.uri.toString()];
|
|
|
+ let uriStr = model.uri.toString();
|
|
|
+ let listener = this._listener[uriStr];
|
|
|
+ if (listener) {
|
|
|
+ listener.dispose();
|
|
|
+ delete this._listener[uriStr];
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
this._disposables.push(monaco.editor.onDidCreateModel(onModelAdd));
|