if the layer has a map property, remove it from the map before destroying.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@539 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -31,6 +31,9 @@ OpenLayers.Layer.prototype = {
|
|||||||
* the Javascript garbage cleaner can not take care of on its own.
|
* the Javascript garbage cleaner can not take care of on its own.
|
||||||
*/
|
*/
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
|
if (this.map != null) {
|
||||||
|
this.map.removeLayer(this);
|
||||||
|
}
|
||||||
this.map = null;
|
this.map = null;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user