From d2859f10efd28f21d04784353840b9a86727af3c Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 7 Sep 2012 03:54:18 +0200 Subject: [PATCH] set src of videos to '' before removing from dom to work around chome bug #31014 --- source/Ox.UI/js/Core/GarbageCollection.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/Ox.UI/js/Core/GarbageCollection.js b/source/Ox.UI/js/Core/GarbageCollection.js index 0d10f72a..59608a59 100644 --- a/source/Ox.UI/js/Core/GarbageCollection.js +++ b/source/Ox.UI/js/Core/GarbageCollection.js @@ -18,8 +18,11 @@ Ox.GarbageCollection = (function() { function collect() { var len = Ox.len(Ox.UI.elements); Object.keys(Ox.UI.elements).forEach(function(id) { - var $element = Ox.UI.elements[id] + var $element = Ox.UI.elements[id]; if ($element && Ox.isUndefined($element.$element.data('oxid'))) { + //Chrome does not properly release resources, reset manually + //http://code.google.com/p/chromium/issues/detail?id=31014 + $element.find('video').attr('src', ''); $element.remove(); delete Ox.UI.elements[id]; }