Skip to content
This repository has been archived by the owner on Jul 25, 2020. It is now read-only.

Memory leak fix #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Memory leak fix #8

wants to merge 1 commit into from

Conversation

jbadeau
Copy link

@jbadeau jbadeau commented May 29, 2013

The following is a memory leak fix that occurs in some browsers when refreshing.

Cheers,
Jose

@buildhive
Copy link

Klaus Reimer » console-shim #13 SUCCESS
This pull request looks good
(what's this?)

@cpburnz
Copy link

cpburnz commented Sep 25, 2014

I'm unaffiliated with this project, but I'm curious to know how using window inside (function() { ... })()causes a memory leak and replacing it with (function(global) { ... })(window) fixes it?

@dmp42
Copy link
Contributor

dmp42 commented Sep 25, 2014

@cpburnz as far as I understand it, the problematic part is:

var console = (/** @type {Object} */ window.console);

Some versions of IE can't dereference the "console" var, thus leaking it.

I don't think using window from the globals arg or directly does make any difference as far as the leak itself is concerned, though.

@cpburnz
Copy link

cpburnz commented Sep 26, 2014

@dmp42 I'm not sure what dereferencing means in the context of Javascript. So by running:

var console = window.console;

That causes IE to leak its reference to the console object which persists between page reloads?

@dmp42
Copy link
Contributor

dmp42 commented Sep 26, 2014

Yes, doing so inside a closure may cause certain IE versions to not free the object between page results.

@sigod sigod mentioned this pull request May 8, 2015
@evil-shrike
Copy link

Why was it not merged?

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

Successfully merging this pull request may close these issues.

5 participants