Side navigation
#7762 closed enhancement (fixed)
Opened December 13, 2010 02:18PM UTC
Closed December 30, 2010 06:03AM UTC
[Events] Remove CPU overhead on unload
Reported by: | iliakan | Owned by: | iliakan |
---|---|---|---|
Priority: | low | Milestone: | 1.5 |
Component: | event | Version: | 1.4.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
There is a bug in IE6 which causes inter-page memory leaks. It is fixed in latest IE6 and IE7, in which the lesser, intra-page memory leak still exists.
The code in events.js fixes this bug by clobbering event handlers:
if ( window.attachEvent && !window.addEventListener) { jQuery(window).bind("unload", function() { alert(1) for ( var id in jQuery.cache ) { if ( jQuery.cache[ id ].handle ) { // Try/Catch is to handle iframes being unloaded, see #4280 try { jQuery.event.remove( jQuery.cache[ id ].handle.elem ); } catch(e) {} } } }); }
But actually it is required in IE6 only and causes extra CPU load in IE7, IE8.
Attachments (0)
Change History (7)
Changed December 13, 2010 02:20PM UTC by comment:1
Changed December 13, 2010 04:22PM UTC by comment:2
owner: | → iliakan |
---|---|
status: | new → pending |
Thanks for taking the time to contribute to the jQuery project! Please provide a reduced jsFiddle test case to help us assess your ticket!
Additionally, test against the latest jQuery release and the jQuery 0 GIT version to ensure the issue still exists. Be Excellent to eachother!
Additionally - patches should be submitted in the form of committed pull requests to the github repo, https://github.com/jquery/jquery
Changed December 14, 2010 08:28PM UTC by comment:3
_comment0: | Pull request is complete. → 1292358629135047 |
---|---|
status: | pending → new |
Pull request is complete.
Changed December 14, 2010 09:14PM UTC by comment:4
Conditional comments can be replaced by
if ( && !window.XmlHttpRequest )
The point is to prevent IE6 code from adding overhead on IE7 and IE8.
Changed December 18, 2010 11:52PM UTC by comment:5
_comment0: | New pull: https://github.com/jquery/jquery/pull/136 → 1292761354109009 |
---|---|
_comment1: | New pull, after discussion with rwaldron and joebourg: https://github.com/jquery/jquery/pull/136 → 1292761515934522 |
New pull, after discussion with rwaldron and jaubourg: https://github.com/jquery/jquery/pull/136
Changed December 26, 2010 09:41PM UTC by comment:6
component: | unfiled → event |
---|---|
milestone: | 1.next → 1.5 |
priority: | undecided → low |
status: | new → open |
Superceded by https://github.com/jquery/jquery/pull/149
The patch: