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) + }); + } }; } }