diff --git a/src/common/EventEmitter.ts b/src/common/EventEmitter.ts index ea9df48bee..5991e338d1 100644 --- a/src/common/EventEmitter.ts +++ b/src/common/EventEmitter.ts @@ -56,11 +56,10 @@ export class EventEmitter implements IEventEmitter { } } -public dispose(): void { - if (this._listeners) { - this._listeners.splice(0, this._listeners.length); + public dispose(): void { + if (this._listeners) { + this._listeners.length = 0; + } + this._disposed = true; } - this._disposed = true; -} - }