Fixed several destroy() methods to avoid running into undefined objects when the page unloads. r=crschmidt,me (closes #1222)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6172 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -45,11 +45,13 @@ OpenLayers.Control.Panel = OpenLayers.Class(OpenLayers.Control, {
|
||||
destroy: function() {
|
||||
OpenLayers.Control.prototype.destroy.apply(this, arguments);
|
||||
for(var i = this.controls.length - 1 ; i >= 0; i--) {
|
||||
this.controls[i].events.un({
|
||||
"activate": this.redraw,
|
||||
"deactivate": this.redraw,
|
||||
scope: this
|
||||
});
|
||||
if(this.controls[i].events) {
|
||||
this.controls[i].events.un({
|
||||
"activate": this.redraw,
|
||||
"deactivate": this.redraw,
|
||||
scope: this
|
||||
});
|
||||
}
|
||||
OpenLayers.Event.stopObservingElement(this.controls[i].panel_div);
|
||||
this.controls[i].panel_div = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user