Keyboard-related classes get destroy(). Fixes #598. Ba-ding.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@2936 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Schuyler Erle
2007-03-30 22:03:05 +00:00
parent 68bf0c0c4c
commit de9ae4a5bb
2 changed files with 21 additions and 0 deletions

View File

@@ -23,6 +23,18 @@ OpenLayers.Control.KeyboardDefaults.prototype =
OpenLayers.Control.prototype.initialize.apply(this, arguments);
},
/**
*
*/
destroy: function() {
if (this.handler) {
this.handler.destroy();
}
this.handler = null;
OpenLayers.Control.prototype.destroy.apply(this, arguments);
},
/**
*
*/

View File

@@ -32,6 +32,15 @@ OpenLayers.Handler.Keyboard.prototype = OpenLayers.Class.inherit( OpenLayers.Han
this.eventListener = this.handleKeyEvent.bindAsEventListener(this);
},
/**
*
*/
destroy: function() {
this.deactivate();
this.eventListener = null;
OpenLayers.Control.prototype.destroy.apply(this, arguments);
},
activate: function() {
OpenLayers.Handler.prototype.activate.apply(this, arguments);
for (var i = 0; i < this.KEY_EVENTS.length; i++) {