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
This commit is contained in:
euzuro
2006-06-05 15:33:05 +00:00
parent 0a1385b22d
commit a4d0badaeb

View File

@@ -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;
},