From 6fcac07ee9d2de616b1ac2deaea6fb4562f120e7 Mon Sep 17 00:00:00 2001 From: rolux Date: Sat, 23 Jun 2012 20:23:19 +0200 Subject: [PATCH] minor changes --- source/Ox.UI/js/Core/GarbageCollection.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/source/Ox.UI/js/Core/GarbageCollection.js b/source/Ox.UI/js/Core/GarbageCollection.js index 5446a0f6..f11f6c48 100644 --- a/source/Ox.UI/js/Core/GarbageCollection.js +++ b/source/Ox.UI/js/Core/GarbageCollection.js @@ -18,11 +18,9 @@ Ox.GarbageCollection = (function() { function collect() { var len = Ox.len(Ox.UI.elements); Object.keys(Ox.UI.elements).forEach(function(id) { - if ( - Ox.UI.elements[id] - && Ox.isUndefined(Ox.UI.elements[id].$element.data('oxid')) - ) { - Ox.UI.elements[id].remove(); + var $element = Ox.UI.elements[id] + if ($element && Ox.isUndefined($element.$element.data('oxid'))) { + $element.remove(); delete Ox.UI.elements[id]; } });