fixed memory leak in the PanZoom control. Thanks rcoup for the patch and the test. p=rcoup, r=me (closes #2323)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@9763 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2009-10-25 17:36:10 +00:00
parent 56382e8e49
commit dbcab22339
2 changed files with 42 additions and 0 deletions

View File

@@ -163,6 +163,7 @@ OpenLayers.Control.PanZoom = OpenLayers.Class(OpenLayers.Control, {
_removeButton: function(btn) {
OpenLayers.Event.stopObservingElement(btn);
btn.map = null;
btn.getSlideFactor = null;
this.div.removeChild(btn);
OpenLayers.Util.removeItem(this.buttons, btn);
},