Opened 12 years ago
Closed 12 years ago
#7842 closed bug (invalid)
Mmeory leak in support code
Reported by: | chancharles | Owned by: | chancharles |
---|---|---|---|
Priority: | undecided | Milestone: | 1.6 |
Component: | unfiled | Version: | 1.4.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
The following code will cause the "div" to leak in IE8:
if ( div.attachEvent && div.fireEvent ) { div.attachEvent("onclick", function click() { // Cloning a node shouldn't copy over any // bound event handlers (IE does this) jQuery.support.noCloneEvent = false; div.detachEvent("onclick", click); }); div.cloneNode(true).fireEvent("onclick"); } div = document.createElement("div");
To fix this problem, we can add:
div.outerHTML = ;
before the div assignment:
div.outerHTML = ''; div = document.createElement("div");
This is IE specific.
Change History (3)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Owner: | set to chancharles |
---|---|
Status: | new → pending |
Thanks for taking the time to contribute to the jQuery project!
Is there any way that you can show evidence of this memory leak?
comment:3 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!
The following "null" assignments will also cause memory leak in IE8:
We can change them to: