From d554583b87fa4ed9e00c7922923a3e045d58ea20 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 6 Sep 2010 17:44:39 -0400 Subject: [PATCH] Properly unlisten to tile events. --- web_frontend/actor.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/web_frontend/actor.js b/web_frontend/actor.js index 2c7553a..3a4b6a7 100644 --- a/web_frontend/actor.js +++ b/web_frontend/actor.js @@ -72,10 +72,22 @@ armadillo.Actor.isModal = function() { */ armadillo.Actor.prototype.disposeInternal = function() { armadillo.Actor.superClass_.disposeInternal.call(this); + + // Unlisten the tiles. + var tiles = goog.dom.getElementsByClassName('tile', this.element_); + goog.array.forEach(tiles, function (tile) { + goog.events.unlistenByKey(tile.actorListener); + }); + + // Remove the actor display element. goog.dom.removeNode(this.element_); this.element_ = null; + + // Kill the popup. this.popup_.dispose(); this.popup_ = null; + + // Remove the actor from the list. goog.array.remove(armadillo.Actor.actors_, this); }; -- 2.43.5