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", {
259
259
} ,
260
260
261
261
_processPanels : function ( ) {
262
+ var prevHeaders = this . headers ,
263
+ prevPanels = this . panels ;
264
+
262
265
this . headers = this . element . find ( this . options . header )
263
266
. addClass ( "ui-accordion-header ui-state-default ui-corner-all" ) ;
264
267
265
- this . headers . next ( )
268
+ this . panels = this . headers . next ( )
266
269
. addClass ( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" )
267
270
. filter ( ":not(.ui-accordion-content-active)" )
268
271
. 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
+ }
269
278
} ,
270
279
271
280
_refresh : function ( ) {
You can’t perform that action at this time.
0 commit comments