File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -372,7 +372,10 @@ return $.widget( "ui.tabs", {
372
372
} ,
373
373
374
374
_processTabs : function ( ) {
375
- var that = this ;
375
+ var that = this ,
376
+ prevTabs = this . tabs ,
377
+ prevAnchors = this . anchors ,
378
+ prevPanels = this . panels ;
376
379
377
380
this . tablist = this . _getList ( )
378
381
. addClass ( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
@@ -456,6 +459,13 @@ return $.widget( "ui.tabs", {
456
459
this . panels
457
460
. addClass ( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
458
461
. attr ( "role" , "tabpanel" ) ;
462
+
463
+ // Avoid memory leaks (#10056)
464
+ if ( prevTabs ) {
465
+ this . _off ( prevTabs . not ( this . tabs ) ) ;
466
+ this . _off ( prevAnchors . not ( this . anchors ) ) ;
467
+ this . _off ( prevPanels . not ( this . panels ) ) ;
468
+ }
459
469
} ,
460
470
461
471
// allow overriding how to find the list for rare usage scenarios (#7715)
You can’t perform that action at this time.
0 commit comments