From 7871d26df452ef1922f18f9cef15d59fc34777e1 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Tue, 15 May 2007 21:14:26 +0000 Subject: [PATCH] Since we have a destroyFeatures command, use it. Patch from fredj, closes #703. git-svn-id: http://svn.openlayers.org/trunk/openlayers@3151 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/Vector.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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) {