Merge pull request #10872 from Snuffleupagus/api-clear-arrays
Re-use, rather than re-creating, some `Array`s when resetting them in `src/display/api.js`
This commit is contained in:
commit
3b58863d4c
@ -1377,7 +1377,7 @@ class LoopbackPort {
|
|||||||
}
|
}
|
||||||
|
|
||||||
terminate() {
|
terminate() {
|
||||||
this._listeners = [];
|
this._listeners.length = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1760,8 +1760,8 @@ class WorkerTransport {
|
|||||||
waitOn.push(page._destroy());
|
waitOn.push(page._destroy());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.pageCache = [];
|
this.pageCache.length = 0;
|
||||||
this.pagePromises = [];
|
this.pagePromises.length = 0;
|
||||||
// We also need to wait for the worker to finish its long running tasks.
|
// We also need to wait for the worker to finish its long running tasks.
|
||||||
const terminated = this.messageHandler.sendWithPromise('Terminate', null);
|
const terminated = this.messageHandler.sendWithPromise('Terminate', null);
|
||||||
waitOn.push(terminated);
|
waitOn.push(terminated);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user