Side navigation
#7054 closed bug (fixed)
Opened September 20, 2010 01:10PM UTC
Closed January 09, 2011 10:26PM UTC
Last modified November 07, 2013 06:41AM UTC
Memory leaks when bind custom event in IE8
Reported by: | fallingdust | Owned by: | dmethvin |
---|---|---|---|
Priority: | blocker | Milestone: | 1.5 |
Component: | event | Version: | 1.4.3 |
Keywords: | memory leak | Cc: | |
Blocked by: | Blocking: |
Description
In jQuery, when binding a custom event, i.e., 'abc' in IE8, and then remove the element by calling remove(). attachEvent and detachEvent will be called. But actually detachEvent won't break the reference chain, the memory leaks...
Also, the following code leaks in IE8:
function testLeak(){
var div = document.createElement('div');
div.innerHTML = new Array(1000).join(new Array(1000).join('x'));
var handler = function(){
};
div.attachEvent('onabc', handler);
div.detachEvent('onabc', handler);
}
setInterval(testLeak, 1000);
Attachments (0)
Change History (14)
Changed October 14, 2010 09:58PM UTC by comment:1
owner: | → fallingdust |
---|---|
priority: | → undecided |
status: | new → pending |
Changed October 16, 2010 06:44PM UTC by comment:2
status: | pending → new |
---|
Here is the test case on jsfiddle:
Changed October 16, 2010 08:34PM UTC by comment:3
milestone: | 1.4.2 → 1.next |
---|---|
priority: | undecided → blocker |
status: | new → open |
version: | 1.4.2 → 1.4.3 |
Changed October 21, 2010 10:56PM UTC by comment:4
milestone: | 1.4.4 → 1.4.5 |
---|
Retargeting due to severity of 1.4.3 regressions.
Changed October 22, 2010 05:53AM UTC by comment:5
milestone: | 1.4.5 → 1.4.4 |
---|
Retargeting for 1.4.4 as per John’s request.
Changed October 23, 2010 07:21PM UTC by comment:6
owner: | fallingdust → john |
---|---|
status: | open → assigned |
Changed October 28, 2010 02:09AM UTC by comment:7
milestone: | 1.4.4 → 1.4.5 |
---|
Retargeting to next minor release.
Changed December 31, 2010 05:17PM UTC by comment:8
owner: | john → dmethvin |
---|
Changed December 31, 2010 05:39PM UTC by comment:9
Changed January 09, 2011 10:26PM UTC by comment:10
resolution: | → fixed |
---|---|
status: | assigned → closed |
Ensure that the DOM element ref in an event handler is removed by cleanData to avoid an IE6/7/8 memory leak. Fixes #7054.
Changeset: fcf623786aeae20485e5253bd2b66c8758053646
Changed January 14, 2011 10:20PM UTC by comment:11
milestone: | 1.4.5 → 1.5 |
---|
Move fixed tickets to appropriate milestone
Changed July 11, 2012 02:28PM UTC by comment:12
#12055 is a duplicate of this ticket.
Changed February 11, 2013 11:34AM UTC by comment:13
It isn't fixed. See the test case here: http://www.nesterovsky-bros.com/weblog/2013/02/10/jquerysTickets7054ClosedBugFixed.aspx
Changed November 07, 2013 06:41AM UTC by comment:14
+1, this isn't fixed, the issue is leftover anonymous functions and closure from event handling.
Please provide a link to a live test case demonstrating this issue.