From 38be86f2f98073dafe8450220f250eccd8f5f827 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Benoi=CC=82t=20Pin?= Date: Wed, 24 Jul 2013 13:34:37 +0200 Subject: [PATCH 1/1] =?utf8?q?optimisation=20empreinte=20m=C3=A9moire.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- skins/fileupload.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/skins/fileupload.js b/skins/fileupload.js index 8f6eeda..c202bfe 100644 --- a/skins/fileupload.js +++ b/skins/fileupload.js @@ -93,8 +93,10 @@ DDFileUploader.prototype.uploadCompleteHandler = function(req) { var fragment = getCopyOfNode(req.responseXML.documentElement.firstChild); var img = fragment.getElementsByTagName('img')[0]; img.onload = function(evt) { - var preview = slide.getElementsByTagName('img')[0]; - preview.src = undefined; + // accelerate GC before replacing + slide.img.src = ''; + slide.img.parentNode.removeChild(slide.img); + slide.img = undefined; slide.parentNode.replaceChild(fragment, slide); }; this.previewsLoaded--; -- 2.20.1