Skip to main content

Search and Top Navigation

#15136 closed bug (fixed)

Opened February 06, 2017 12:47AM UTC

Closed April 19, 2017 04:54PM UTC

Last modified April 19, 2017 04:57PM UTC

lots of duplicated events / memory leaks with tabs widget

Reported by: steph68 Owned by: scottgonzalez
Priority: minor Milestone: 1.12.2
Component: ui.tabs Version: 1.12.1
Keywords: Cc:
Blocked by: Blocking:

I've a lot of duplicated events and memory leaks with tabs widget.

An endless growing list of events like:

"remove" on the tabs container

"focusin", "mousedown" and "remove" on the tabs list ...

Some undesirable object references in "bindings", "classesElementLookup" ... which keep alive objects after a remove (memory leaks)

for example: in "tabs.js / function _processTabs", you setup tracked classes like this:

this._addClass( this.anchors, "ui-tabs-anchor" );

but, after in the function "_setupEvents", you get rid of all events with this :

this._off( this.anchors.add( this.tabs ).add( this.panels ) );

but in this case, the function "_untrackClassesElement" will never be triggered ...

and "classesElementLookup" will keep the anchor reference forever

another thing found in the source (small mistake, no consequence but dead code):

file widget.js / function _on :

if ( selector ) {
	delegateElement.on( eventName, selector, handlerProxy );
} else {
	element.on( eventName, handlerProxy );

selector is a string, so the if statement will be ever true

should be

if (selector.length)
Attachments (0)
Change History (4)

Changed February 06, 2017 12:59AM UTC by steph68 comment:1

Your demo here show the problem.

Look on events of "#tabs" and "#tabs ul" and play with the add and the close buttons.

$._data($("#tabs")[0], "events");

Changed April 19, 2017 04:54PM UTC by scottgonzalez comment:2

owner: → scottgonzalez
resolution: → fixed
status: newclosed

In [changeset:"ef2e9bab92ae898311baa295590cd487d9071319" ef2e9ba]:

#!CommitTicketReference repository="" revision="ef2e9bab92ae898311baa295590cd487d9071319"
Widget: Improve  event bindings for  options

Fixes #15078
Fixes #15082
Fixes #15095
Fixes #15136
Fixes #15152
Closes gh-1769

Changed April 19, 2017 04:57PM UTC by scottgonzalez comment:3

milestone: none1.12.2

Changed April 19, 2017 04:57PM UTC by scottgonzalez comment:4

component: ui.coreui.tabs