Skip to content

Commit

Permalink
dispose of ArrowButton instances, #259
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Aug 23, 2016
1 parent 1650643 commit a1361fa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion js/NumberControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,15 @@ define( function( require ) {

// @private
this.disposeNumberControl = function() {

numberDisplay.dispose();
leftArrowButton.dispose();
rightArrowButton.dispose();
slider.dispose();

numberProperty.unlink( arrowEnabledListener );
thisNode.enabledProperty.unlink( enabledObserver );
slider.dispose();

options.tandem && options.tandem.removeInstance( thisNode );
};

Expand Down
4 changes: 3 additions & 1 deletion js/WavelengthSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,10 @@ define( function( require ) {
options.tandem && options.tandem.addInstance( this, TNode );

this.disposeWavelengthSlider = function() {
options.tandem && options.tandem.removeInstance( this );
plusButton && plusButton.dispose();
minusButton && minusButton.dispose();
wavelength.unlink( wavelengthListener );
options.tandem && options.tandem.removeInstance( this );
};
}

Expand Down

0 comments on commit a1361fa

Please sign in to comment.