diff options
author | Oleg <markelog@gmail.com> | 2012-04-04 21:17:01 -0400 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2012-04-04 21:38:46 -0400 |
commit | 203a168980ece60213c87a10ac0ad294783d5563 (patch) | |
tree | d4bd8461d3454731b47179d60cff10eaad03558d /src/data.js | |
parent | 41056ab1957b44bf5be2184f5c566121a985b38a (diff) | |
download | jquery-203a168980ece60213c87a10ac0ad294783d5563.tar.gz jquery-203a168980ece60213c87a10ac0ad294783d5563.zip |
Fix #8545. Plug event handling memory leak in oldIE.
Diffstat (limited to 'src/data.js')
-rw-r--r-- | src/data.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/data.js b/src/data.js index 017bd2efd..ff4309f1e 100644 --- a/src/data.js +++ b/src/data.js @@ -6,6 +6,8 @@ var rbrace = /^(?:\{.*\}|\[.*\])$/, jQuery.extend({ cache: {}, + deletedIds: [], + // Please use with caution uuid: 0, @@ -59,7 +61,7 @@ jQuery.extend({ // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if ( isNode ) { - elem[ internalKey ] = id = ++jQuery.uuid; + elem[ internalKey ] = id = jQuery.deletedIds.pop() || ++jQuery.uuid; } else { id = internalKey; } @@ -212,6 +214,8 @@ jQuery.extend({ // We destroyed the cache and need to eliminate the expando on the node to avoid // false lookups in the cache for entries that no longer exist if ( isNode ) { + jQuery.deletedIds.push( id ); + // IE does not allow us to delete expando properties from nodes, // nor does it have a removeAttribute function on Document nodes; // we must handle all of these cases |