Properly destroy features in the point, path, and polygon handlers. Patch with tests from fredj - thank you for the catch and the great patch. (Closes #931)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@4063 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2007-08-27 21:03:28 +00:00
parent 661d643b4f
commit 2d636c1ae4
4 changed files with 54 additions and 1 deletions
+2 -1
View File
@@ -78,8 +78,9 @@ OpenLayers.Handler.Path = OpenLayers.Class(OpenLayers.Handler.Point, {
* Destroy temporary geometries
*/
destroyFeature: function() {
OpenLayers.Handler.Point.prototype.destroyFeature.apply(this);
this.line.destroy();
this.point.destroy();
this.line = null;
},
/**
+2
View File
@@ -116,6 +116,7 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, {
}
this.map.removeLayer(this.layer, false);
this.layer.destroy();
this.layer = null;
return true;
},
@@ -125,6 +126,7 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, {
*/
destroyFeature: function() {
this.point.destroy();
this.point = null;
},
/**