From 3520c32140e0bd326f3d5e661de7c3543cc3dc43 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Sat, 21 Aug 2010 16:10:21 +0000 Subject: [PATCH] In order to resolve a memory leak in IE, observable via drip, remove elemnts from panels before calling innerHTML. This resolves the memory error. All tests pass in FF and IE, and there are no obvious side effects I can imagine; committing. Patch from aabt, r=me, (Closes #2745) git-svn-id: http://svn.openlayers.org/trunk/openlayers@10665 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Control/Panel.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/OpenLayers/Control/Panel.js b/lib/OpenLayers/Control/Panel.js index 15614f1b6a..749329d2fb 100644 --- a/lib/OpenLayers/Control/Panel.js +++ b/lib/OpenLayers/Control/Panel.js @@ -146,6 +146,11 @@ OpenLayers.Control.Panel = OpenLayers.Class(OpenLayers.Control, { * Method: redraw */ redraw: function() { + if (this.div.children.length>0) { + for (var l=this.div.children.length, i=l-1 ; i>=0 ; i--) { + this.div.removeChild(this.div.children[i]); + } + } this.div.innerHTML = ""; if (this.active) { for (var i=0, len=this.controls.length; i