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:
@@ -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;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user