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() {
|
||||
this.deactivate();
|
||||
this.layer = null;
|
||||
this.options = null;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,13 +14,15 @@
|
||||
}
|
||||
|
||||
function test_destroy(t) {
|
||||
t.plan(1);
|
||||
t.plan(2);
|
||||
var strategy = new OpenLayers.Strategy({
|
||||
options: {foo: 'bar'},
|
||||
layer: 'foo'
|
||||
});
|
||||
strategy.destroy();
|
||||
|
||||
t.eq(strategy.layer, null, "destroy nullify protocol.layer");
|
||||
t.eq(strategy.options, null, "destroy nullify protocol.options");
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user