Bug Tracker

Opened 2 years ago

Closed 2 years ago

#14544 closed feature (fixed)

Remove elem reference from event handler

Reported by: dmethvin Owned by: dmethvin
Priority: low Milestone: 2.1
Component: event Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:


The reference to the element being handled at https://github.com/jquery/jquery/blob/7f0b28e3083ab8e755801823166e1b008d128242/src/event.js#L80 was there to prevent oldIE leaks so it can be removed in master.

This change will also be useful if we attach data directly to elements, because we may be able to get away with only calling teardown for special events rather than all events on discarded elements.

PR: https://github.com/jquery/jquery/pull/1400

Change History (3)

comment:1 Changed 2 years ago by dmethvin

  • Component changed from unfiled to event
  • Milestone changed from None to 2.1
  • Owner set to dmethvin
  • Priority changed from undecided to low
  • Status changed from new to assigned
  • Type changed from bug to feature

comment:2 Changed 2 years ago by dmethvin

Ref #11570

comment:3 Changed 2 years ago by Ilya Kantor

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

Event: Fix #14544. Remove elem from event handle, close gh-1400.

This also reduces memory leaks if the element is removed without cleaning events (e.g with native DOM operations).

Not pickable into the 1.x branch because oldIE still needs this.

Changeset: d0782ed7e81a181f0541e1ce7c8cba0825a80299

Note: See TracTickets for help on using tickets.