From a4d0badaeb2a754163d24412a77855f019aa5bb1 Mon Sep 17 00:00:00 2001 From: euzuro Date: Mon, 5 Jun 2006 15:33:05 +0000 Subject: [PATCH] Fix for bug introduced with r510. Only make the removeChild call if the parentNode is properly set. This way we can zap the grid div contents quickly with the div.innerHTML = "" but still have a valid good destroy() function. git-svn-id: http://svn.openlayers.org/trunk/openlayers@511 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Tile/Image.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/OpenLayers/Tile/Image.js b/lib/OpenLayers/Tile/Image.js index 1fa9ba69ec..686a04fb8e 100644 --- a/lib/OpenLayers/Tile/Image.js +++ b/lib/OpenLayers/Tile/Image.js @@ -23,7 +23,9 @@ OpenLayers.Tile.Image.prototype = }, destroy: function() { - this.layer.div.removeChild(this.img); + if (this.img.parentNode == this.layer.div) { + this.layer.div.removeChild(this.img); + } this.img = null; },