From f9622cf0fdf8766b2bdba3ed840ee6b4bd12d787 Mon Sep 17 00:00:00 2001 From: Anand Thakker Date: Thu, 11 Aug 2016 13:01:56 -0400 Subject: [PATCH] Include mapId in Actors' callback tracking --- js/util/actor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/util/actor.js b/js/util/actor.js index 0c0fd9da40c..9aefb0298de 100644 --- a/js/util/actor.js +++ b/js/util/actor.js @@ -56,8 +56,8 @@ Actor.prototype.receive = function(message) { }; Actor.prototype.send = function(type, data, callback, buffers) { - var id = null; - if (callback) this.callbacks[id = this.callbackID++] = callback; + var id = callback ? this.mapId + ':' + this.callbackID++ : null; + if (callback) this.callbacks[id] = callback; this.postMessage({ mapId: this.mapId, type: type, id: String(id), data: data }, buffers); };