set src of videos to '' before removing from dom to work around chome bug #31014

This commit is contained in:
j 2012-09-07 03:54:18 +02:00
parent 075aac449c
commit d2859f10ef

View file

@ -18,8 +18,11 @@ Ox.GarbageCollection = (function() {
function collect() { function collect() {
var len = Ox.len(Ox.UI.elements); var len = Ox.len(Ox.UI.elements);
Object.keys(Ox.UI.elements).forEach(function(id) { 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'))) { 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(); $element.remove();
delete Ox.UI.elements[id]; delete Ox.UI.elements[id];
} }