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:
crschmidt
2006-05-13 01:34:27 +00:00
parent bc8197969d
commit a758b9f3e8

View File

@@ -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;
}
}
});