From 6c67b3a0e3cd2826b13f22b1cedba89f129a2d1f Mon Sep 17 00:00:00 2001 From: crschmidt Date: Thu, 29 Mar 2007 16:25:52 +0000 Subject: [PATCH] By setting the innerHTML of the icon, we tell browsers they can clean up the memory associated with those images. This completes #581, and reduces the memory used by applications where adding and removing of many markers is used. git-svn-id: http://svn.openlayers.org/trunk/openlayers@2925 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Icon.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/OpenLayers/Icon.js b/lib/OpenLayers/Icon.js index 7046f2d7c1..07f0e2323d 100644 --- a/lib/OpenLayers/Icon.js +++ b/lib/OpenLayers/Icon.js @@ -52,6 +52,8 @@ OpenLayers.Icon.prototype = { }, destroy: function() { + OpenLayers.Event.stopObserving(this.imageDiv.firstChild); + this.imageDiv.innerHTML = ""; this.imageDiv = null; },