#15136 closed bug (fixed)
lots of duplicated events / memory leaks with tabs widget
Reported by: | steph68 | Owned by: | Scott González |
---|---|---|---|
Priority: | minor | Milestone: | 1.12.2 |
Component: | ui.tabs | Version: | 1.12.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
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)
Change History (4)
comment:1 Changed 6 years ago by
comment:2 Changed 6 years ago by
Owner: | set to Scott González |
---|---|
Resolution: | → fixed |
Status: | new → closed |
In ef2e9ba:
comment:3 Changed 6 years ago by
Milestone: | none → 1.12.2 |
---|
comment:4 Changed 6 years ago by
Component: | ui.core → ui.tabs |
---|
Your demo here https://jqueryui.com/tabs/#manipulation show the problem. Look on events of "#tabs" and "#tabs ul" and play with the add and the close buttons.