From d22a9988faefd918e9f2c406d2bada064b0d6b90 Mon Sep 17 00:00:00 2001 From: Andrew Dupont Date: Fri, 27 Feb 2009 16:45:51 -0600 Subject: [PATCH] Null out references to elements in cache on page unload. Need this in addition to the Event#stopObserving calls to clean up memory leaks. [#425 state:resolved] (ykphuah, mr_justin, Andrew Dupont) --- CHANGELOG | 2 ++ src/dom/event.js | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 40bda7d..e67b998 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Null out references to elements in cache on page unload. Need this in addition to the Event#stopObserving calls to clean up memory leaks. [#425 state:resolved] (ykphuah, mr_justin, Andrew Dupont) + * Ensure `toString` and `valueOf` properties are copied to a subclass only when necessary in IE6. [@382 state:resolved] (Samuel Lebeau) * Make sure `getAttribute` is used without flag when accessing the "type" attribute of an iframe (IE throws error otherwise). [#118 state:resolved] (Zekid, kangax) diff --git a/src/dom/event.js b/src/dom/event.js index 2feaa0c..0fa3fec 100644 --- a/src/dom/event.js +++ b/src/dom/event.js @@ -1,7 +1,7 @@ (function() { /** section: dom - * Event + * Event **/ var Event = { KEY_BACKSPACE: 8, @@ -299,8 +299,10 @@ } function _destroyCache() { - for (var i = 0, length = CACHE.length; i < length; i++) + for (var i = 0, length = CACHE.length; i < length; i++) { Event.stopObserving(CACHE[i]); + CACHE[i] = null; + } } var CACHE = []; @@ -481,7 +483,7 @@ }); /** section: dom - * document + * document **/ Object.extend(document, { /** related to: Event.fire