From 542fbb4fcdb6657712fdea8d510bcf85bc5dfeb1 Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Tue, 16 Jul 2019 17:43:30 -0400 Subject: [PATCH] fix #8481, unbounded memory growth in IE (#8490) Cancellable requests to workers should never call back after they have been cancelled. --- src/util/actor.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/util/actor.js b/src/util/actor.js index edeb8b53e70..1e53d7c9a5e 100644 --- a/src/util/actor.js +++ b/src/util/actor.js @@ -56,12 +56,16 @@ class Actor { }, buffers); if (callback) { return { - cancel: () => this.target.postMessage({ - targetMapId, - sourceMapId: this.mapId, - type: '', - id: String(id) - }) + cancel: () => { + // Set the callback to null so that it never fires after the request is aborted. + this.callbacks[id] = null; + this.target.postMessage({ + targetMapId, + sourceMapId: this.mapId, + type: '', + id: String(id) + }); + } }; } }