Changeset 6172
- Timestamp:
- 02/09/08 13:51:48 (1 year ago)
- Files:
-
- trunk/openlayers/lib/OpenLayers/Control.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Control/Panel.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Map.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Control.js
r6167 r6172 167 167 destroy: function () { 168 168 this.events.destroy(); 169 this.events = null; 169 170 // eliminate circular references 170 171 if (this.handler) { trunk/openlayers/lib/OpenLayers/Control/Panel.js
r6167 r6172 46 46 OpenLayers.Control.prototype.destroy.apply(this, arguments); 47 47 for(var i = this.controls.length - 1 ; i >= 0; i--) { 48 this.controls[i].events.un({ 49 "activate": this.redraw, 50 "deactivate": this.redraw, 51 scope: this 52 }); 48 if(this.controls[i].events) { 49 this.controls[i].events.un({ 50 "activate": this.redraw, 51 "deactivate": this.redraw, 52 scope: this 53 }); 54 } 53 55 OpenLayers.Event.stopObservingElement(this.controls[i].panel_div); 54 56 this.controls[i].panel_div = null; trunk/openlayers/lib/OpenLayers/Map.js
r6149 r6172 486 486 } 487 487 488 if (this.controls != null) { 489 for (var i = this.controls.length - 1; i>=0; --i) { 490 this.controls[i].destroy(); 491 } 492 this.controls = null; 493 } 488 494 if (this.layers != null) { 489 495 for (var i = this.layers.length - 1; i>=0; --i) { … … 493 499 } 494 500 this.layers = null; 495 }496 if (this.controls != null) {497 for (var i = this.controls.length - 1; i>=0; --i) {498 this.controls[i].destroy();499 }500 this.controls = null;501 501 } 502 502 if (this.viewPortDiv) {
