Bug Tracker

Ticket #1731 (closed bug: fixed)

Opened 7 years ago

Last modified 7 years ago

New "handler" created for each event added and leaks memory in IE

Reported by: arrix Owned by:
Priority: major Milestone: 1.2.2
Component: event Version: 1.2.1
Keywords: Cc:
Blocking: Blocked by:

Description

See the conversation titled possible bug in event code in dev list.

In event.js line 46

var handle = jQuery.data(element, "handle", function(){

should instead be

var handle = jQuery.data(element, "handle") || jQuery.data(element, "handle", function () {

David: "It looks like the code was always creating a new handle for each event added instead of getting an existing handle out of the cache when it was already there."

The handlers overwritten can never be removed and cause memory leaks.

Related tickets are #1697, #1618 and #1610.

Attachments

1731.diff Download (1.2 KB) - added by brandon 7 years ago.
Patch
1731.2.diff Download (6.5 KB) - added by brandon 7 years ago.
Fixes leaks in remove, html, empty and expands small variables

Change History

comment:1 Changed 7 years ago by harking

Patch fixed unbind issue in ie6.

Changed 7 years ago by brandon

Patch

Changed 7 years ago by brandon

Fixes leaks in remove, html, empty and expands small variables

comment:2 Changed 7 years ago by brandon

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in Rev [3578]

Note: See TracTickets for help on using tickets.