Skip to main content

Search and Top Navigation

#9531 closed bug (fixed)

Opened September 04, 2013 12:36PM UTC

Closed January 09, 2014 09:13AM UTC

Last modified January 09, 2014 09:13AM UTC

Tooltip: memory leak - not unbinding remove event

Reported by: mdownes Owned by:
Priority: minor Milestone: 1.11.0
Component: ui.tooltip Version: 1.10.3
Keywords: Cc:
Blocked by: Blocking:
Description

Hi,

There seems to be a memory leak in the tooltip where the remove event never gets unbound.

Please see the jsfiddle test below for a demonstration.

Basically , after hovering over the textbox more and more remove events get bound added and none get unbound.

I found this in version 1.9.2 but the test below uses the latest version and it is still present.

http://jsfiddle.net/kD6MS/3/

Kind Regards,

Maurice

Attachments (0)
Change History (7)

Changed September 04, 2013 03:33PM UTC by tj.vantoll comment:1

status: newopen
summary: Tooltip memory leak - not unbinding remove eventTooltip: memory leak - not unbinding remove event

Confirmed. A remove handler is bound everytime to tooltip is opened but is only removed for delegated targets:

// Remove 'remove' binding only on delegated targets
if ( target[0] !== this.element[0] ) {
    this._off( target, "remove" );
}

This might be addressed by the text for #8740.

Changed December 30, 2013 02:39AM UTC by robotdan comment:2

Fork of the initial jsFiddle w/ the patch from #8740

http://jsfiddle.net/robotdan/v99hx/

Assuming I'm picking up the patched

jquery.ui.tooltip.js
it looks like the issue still exists.

Changed December 30, 2013 04:59AM UTC by robotdan comment:3

The code block referenced above in comment 1 was added as a result of #8646 under commit https://github.com/jquery/jquery-ui/commit/3b2d1e7736be99671af70aa3b775d67b917517e5.

Some additional investigation should be done to see if the

remove
handler can always be removed or if some additional logic is required to resolve this issue as well as preserve the fix for #8846.

Changed December 30, 2013 01:13PM UTC by tj.vantoll comment:4

Replying to [comment:2 robotdan]:

Fork of the initial jsFiddle w/ the patch from #8740 http://jsfiddle.net/robotdan/v99hx/ Assuming I'm picking up the patched
jquery.ui.tooltip.js
it looks like the issue still exists.

You are bringing in the script file appropriately, so it looks like that fix doesn't address this issue.

Changed January 02, 2014 09:54PM UTC by scottgonzalez comment:5

Changed January 09, 2014 09:13AM UTC by Scott González comment:6

resolution: → fixed
status: openclosed

Tooltip: Only bind remove handler for delegated tooltips

The remove handler was being added for every tooltip, but only removed for

delegated tooltips. The default destroy behavior already handles non-delegated

tooltips, so the handler should only be added for delegated tooltips.

Fixes #9531

Closes gh-1156

Changeset: a8ff77360b78b7eabcffd97b8b11c2d1f150ed4e

Changed January 09, 2014 09:13AM UTC by scottgonzalez comment:7

milestone: none1.11.0