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:
@@ -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
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user