Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Observed elements should only be pushed to the CACHE if on IE #200

Closed
jwestbrook opened this issue May 7, 2014 · 3 comments
Closed

Observed elements should only be pushed to the CACHE if on IE #200

jwestbrook opened this issue May 7, 2014 · 3 comments

Comments

@jwestbrook
Copy link
Collaborator

previous lighthouse ticket #1025
by ronin-93814 (at lighthouseapp)


All observed elements are being pushed to the CACHE array. This array is used only on IE to be able to clean up the event listeners in the _destroyCache method, which is called upon window.onunload. This patch puts an if (Prototype.Browser.IE) around the invocation of CACHE.push(element); to save some memory on other browsers.

This ticket is related to #466 (Suppress memory leaks from Element.remove and Elemen.update).

@jwestbrook
Copy link
Collaborator Author

ronin-93814 (at lighthouseapp)
April 7th, 2010 @ 10:43 AM

From e795810fd997514b8e6ebd77972291308536f882 Mon Sep 17 00:00:00 2001
From: Jochen Berger <fooberger@googlemail.com>
Date: Wed, 7 Apr 2010 10:36:19 +0200
Subject: [PATCH] Only push observed elements to the CACHE if on IE

---
 src/dom/event.js |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/dom/event.js b/src/dom/event.js
index 6efac7d..1a18265 100644
--- a/src/dom/event.js
+++ b/src/dom/event.js
@@ -423,8 +423,10 @@
     var registry = Element.retrieve(element, 'prototype_event_registry');

     if (Object.isUndefined(registry)) {
-      // First time we've handled this element. Put it into the cache.
-      CACHE.push(element);
+      if (Prototype.Browser.IE) {
+        // First time we've handled this element. Put it into the cache.
+        CACHE.push(element);
+      }
       registry = Element.retrieve(element, 'prototype_event_registry', $H());
     }

-- 
1.6.3.3

@jwestbrook
Copy link
Collaborator Author

ronin-93814 (at lighthouseapp)
April 13th, 2011 @ 10:54 AM

still an issue with prototype 1.7

@savetheclocktower
Copy link
Collaborator

We do this differently now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants