diff --git a/lib/OpenLayers/Tile/Image.js b/lib/OpenLayers/Tile/Image.js index 1ba3c94b88..f204f9af9e 100644 --- a/lib/OpenLayers/Tile/Image.js +++ b/lib/OpenLayers/Tile/Image.js @@ -32,9 +32,12 @@ OpenLayers.Tile.Image.prototype = * */ destroy: function() { - if ((this.imgDiv != null) && (this.imgDiv.parentNode == this.layer.div)) { - this.layer.div.removeChild(this.imgDiv); - this.imgDiv.map = null; + if (this.imgDiv != null) { + OpenLayers.Event.stopObservingElement(this.imgDiv.id); + if (this.imgDiv.parentNode == this.layer.div) { + this.layer.div.removeChild(this.imgDiv); + this.imgDiv.map = null; + } } this.imgDiv = null; OpenLayers.Tile.prototype.destroy.apply(this, arguments);