Skip to content

Commit

Permalink
fix #8481, unbounded memory growth in IE (#8490)
Browse files Browse the repository at this point in the history
Cancellable requests to workers should never call back after they have
been cancelled.
  • Loading branch information
ansis committed Jul 18, 2019
1 parent 2dbd0dd commit 9e17462
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/util/actor.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,16 @@ class Actor {
}, buffers);
if (callback) {
return {
cancel: () => this.target.postMessage({
targetMapId,
sourceMapId: this.mapId,
type: '<cancel>',
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: '<cancel>',
id: String(id)
});
}
};
}
}
Expand Down

0 comments on commit 9e17462

Please sign in to comment.