Add 'destroy' function to PanZoom control which unsets the 'map' item on all the buttons. This should prevent memory
leaks by removing the circular references to buttons. git-svn-id: http://svn.openlayers.org/trunk/openlayers@24 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -113,5 +113,11 @@ OpenLayers.Control.PanZoom.prototype =
|
||||
case "zoomextents": this.map.zoomExtent(); break;
|
||||
}
|
||||
Event.stop(evt);
|
||||
},
|
||||
destroy: function() {
|
||||
OpenLayers.Control.prototype.destroy.apply(this, arguments);
|
||||
for(i=0; i<this.buttons.length; i++) {
|
||||
this.buttons[i].map = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user