"add a destroy() function that cycles through the kept references to the buttons and kills their circular refs" to the map object. Patch in #578 by euzuro

git-svn-id: http://svn.openlayers.org/trunk/openlayers@2919 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-03-29 04:43:18 +00:00
parent 861c105071
commit 4bb320867b

View File

@@ -57,6 +57,19 @@ OpenLayers.Control.MouseToolbar.prototype =
return this.div;
},
/**
*
*/
destroy: function() {
for( var btnId in this.buttons) {
var btn = this.buttons[btnId];
btn.map = null;
btn.events.destroy();
}
OpenLayers.Control.MouseDefaults.prototype.destroy.apply(this,
arguments);
},
_addButton:function(id, img, activeImg, xy, sz, title) {
var imgLocation = OpenLayers.Util.getImagesLocation() + img;