diff --git a/src/display/api.js b/src/display/api.js index 60b7aa63a..c6fbd182f 100644 --- a/src/display/api.js +++ b/src/display/api.js @@ -1377,7 +1377,7 @@ class LoopbackPort { } terminate() { - this._listeners = []; + this._listeners.length = 0; } } @@ -1760,8 +1760,8 @@ class WorkerTransport { waitOn.push(page._destroy()); } }); - this.pageCache = []; - this.pagePromises = []; + this.pageCache.length = 0; + this.pagePromises.length = 0; // We also need to wait for the worker to finish its long running tasks. const terminated = this.messageHandler.sendWithPromise('Terminate', null); waitOn.push(terminated);