For controls with multiple handlers, we now tack them on to a handlers object. The base destroy takes care of the handlers. r=crschmidt,uz/2 (closes #1338)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6106 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -139,6 +139,15 @@ OpenLayers.Control = OpenLayers.Class({
|
||||
this.handler.destroy();
|
||||
this.handler = null;
|
||||
}
|
||||
if(this.handlers) {
|
||||
for(var key in this.handlers) {
|
||||
if(this.handlers.hasOwnProperty(key) &&
|
||||
typeof this.handlers[key].destroy == "function") {
|
||||
this.handlers[key].destroy();
|
||||
}
|
||||
}
|
||||
this.handlers = null;
|
||||
}
|
||||
if (this.map) {
|
||||
this.map.removeControl(this);
|
||||
this.map = null;
|
||||
|
||||
Reference in New Issue
Block a user