3 ms·
The OP never mentions removing the node from the DOM.
by pbiggar 15y ago
The OP never mentions removing the node from the DOM.
- DrJokepu 15y agoIt's kind of implied, isn't it? I mean, it wouldn't make sense to expect something that's still part of the DOM tree to get garbage collected, would it? Unless I'm missing something?
- pbiggar 15y agoYou're right. My initial reading was the closure closed over extra objects (which would be a leak so long as the DOM node is live), but I think the OP is worried about the DOM node leaking.
- spjwebster 15y agoIt was an assumption I made in my reply (now corrected) but it doesn't matter; even without removing the node from the DOM there's a memory leak in IE4-6, one that persists until the browser is terminated. In the other cases, there's no memory leak while the DOM node still exists, because the DOM still has a reference to it so it shouldn't be garbage collected.