Calling map.destroy() twice previously an error in IE. Fixed.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@314 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Schuyler Erle
2006-05-24 05:44:43 +00:00
parent 0417c9feb5
commit cfb1b472a7
+10 -6
View File
@@ -111,14 +111,18 @@ OpenLayers.Map.prototype = {
/** /**
*/ */
destroy:function() { destroy:function() {
for(var i=0; i< this.layers.length; i++) { if (this.layers != null) {
this.layers[i].destroy(); for(var i=0; i< this.layers.length; i++) {
this.layers[i].destroy();
}
this.layers = null;
} }
this.layers = null; if (this.controls != null) {
for(var i=0; i< this.controls.length; i++) { for(var i=0; i< this.controls.length; i++) {
this.controls[i].destroy(); this.controls[i].destroy();
}
this.controls = null;
} }
this.controls = null;
}, },
/** /**