Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
aetherspawn
· 8y ago · 0 comments
I think this is true because they hold a reference in window.
Comments
[–]
mulrian
8y ago
Sure that will prevent gc, but that doesn't mean it's a memory leak
[–]
dspillett
8y ago
It is if the variable is accidentally in global scope due to hoisting if it is not explicitly defined in a finer scope. Not an issue in strict mode, you'll get a reference error instead of an implied global.
[–]
rootlocus
8y ago
If you're never going to use it again, and you're never going to free it, it's a memory leak.
[–]
Sawamara
8y ago
No, it is not. A memory leak has to grow. Without the leak part, it is just ...allocated memory.