File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -259,13 +259,22 @@ return $.widget( "ui.accordion", {
259259 } ,
260260
261261 _processPanels : function ( ) {
262+ var prevHeaders = this . headers ,
263+ prevPanels = this . panels ;
264+
262265 this . headers = this . element . find ( this . options . header )
263266 . addClass ( "ui-accordion-header ui-state-default ui-corner-all" ) ;
264267
265- this . headers . next ( )
268+ this . panels = this . headers . next ( )
266269 . addClass ( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" )
267270 . filter ( ":not(.ui-accordion-content-active)" )
268271 . hide ( ) ;
272+
273+ // Avoid memory leaks (#10056)
274+ if ( prevPanels ) {
275+ this . _off ( prevHeaders . not ( this . headers ) ) ;
276+ this . _off ( prevPanels . not ( this . panels ) ) ;
277+ }
269278 } ,
270279
271280 _refresh : function ( ) {
You can’t perform that action at this time.
0 commit comments