diff --git a/lib/OpenLayers/Layer/Vector.js b/lib/OpenLayers/Layer/Vector.js index 80807f24d1..680fe1bb2a 100644 --- a/lib/OpenLayers/Layer/Vector.js +++ b/lib/OpenLayers/Layer/Vector.js @@ -97,8 +97,7 @@ OpenLayers.Layer.Vector.prototype = destroy: function() { OpenLayers.Layer.prototype.destroy.apply(this, arguments); - // HACK HACK -- I believe we should be iterating and - // calling feature[i].destroy() here. + this.destroyFeatures(); this.features = null; this.selectedFeatures = null; if (this.renderer) {