OpenLayers.Strategy destroy() nullify options property. r=elemoine (closes #1657)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@7690 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Frédéric Junod
2008-08-04 12:25:47 +00:00
parent 397de6fc6a
commit a3ffb5734c
2 changed files with 4 additions and 1 deletions
+1
View File
@@ -41,6 +41,7 @@ OpenLayers.Strategy = OpenLayers.Class({
destroy: function() { destroy: function() {
this.deactivate(); this.deactivate();
this.layer = null; this.layer = null;
this.options = null;
}, },
/** /**
+3 -1
View File
@@ -14,13 +14,15 @@
} }
function test_destroy(t) { function test_destroy(t) {
t.plan(1); t.plan(2);
var strategy = new OpenLayers.Strategy({ var strategy = new OpenLayers.Strategy({
options: {foo: 'bar'},
layer: 'foo' layer: 'foo'
}); });
strategy.destroy(); strategy.destroy();
t.eq(strategy.layer, null, "destroy nullify protocol.layer"); t.eq(strategy.layer, null, "destroy nullify protocol.layer");
t.eq(strategy.options, null, "destroy nullify protocol.options");
} }
</script> </script>