Skip to main content

Bug Tracker

Side navigation

#3159 closed bug (fixed)

Opened July 15, 2008 04:40AM UTC

Closed July 15, 2008 03:58PM UTC

$(..).empty() leaks memory when form is first child

Reported by: jeberma Owned by: flesler
Priority: major Milestone: 1.3
Component: core Version: 1.2.6
Keywords: Cc:
Blocked by: Blocking:

Calling $(expr).empty() on an element who's first child is a form

fails to uncache/unbind that child's data/events. I think this problem can be attributed to the following method chain:

$.empty -> $.remove -> $.add -> $.makeArray

on line 1135 the filter for array-like parameters should possibly test for form elements, as they also have a length property. It seems like the current implementation creates an array of form fields, excluding the form itself.

Please see the attached file for verification.

Attachments (2)
  • remove[5788].diff (0.5 KB) - added by flesler July 15, 2008 03:55PM UTC.

    This is the patch

  • ticket3159.html (0.5 KB) - added by jeberma July 15, 2008 04:42AM UTC.

    Demonstrates uncaching issue. Run with Firebug enabled.

Change History (3)

Changed July 15, 2008 03:54PM UTC by flesler comment:1

need: ReviewPatch
owner: → flesler
status: newassigned

Right, this can be fixed easily.

Changed July 15, 2008 03:55PM UTC by flesler comment:2

need: PatchCommit

Changed July 15, 2008 03:58PM UTC by flesler comment:3

resolution: → fixed
status: assignedclosed

Applied at [5789].