Permalink
Browse files

Accordion: Avoid memory leak during refresh

Ref #10056
Closes gh-1319
  • Loading branch information...
scottgonzalez committed Aug 20, 2014
1 parent 2e8e52d commit 849c6fd5376e12c6093c557bd4836ef0b145f145
Showing with 10 additions and 1 deletion.
  1. +10 −1 ui/accordion.js
View
@@ -259,13 +259,22 @@ return $.widget( "ui.accordion", {
},
_processPanels: function() {
var prevHeaders = this.headers,
prevPanels = this.panels;
this.headers = this.element.find( this.options.header )
.addClass( "ui-accordion-header ui-state-default ui-corner-all" );
this.headers.next()
this.panels = this.headers.next()
.addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" )
.filter( ":not(.ui-accordion-content-active)" )
.hide();
// Avoid memory leaks (#10056)
if ( prevPanels ) {
this._off( prevHeaders.not( this.headers ) );
this._off( prevPanels.not( this.panels ) );
}
},
_refresh: function() {

0 comments on commit 849c6fd

Please sign in to comment.