Skip to content

Commit

Permalink
Pass self for removeInstance, see phetsims/phet-io#1018
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Feb 7, 2017
1 parent 31b015f commit 8e43ec1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/singlebulb/model/SingleBulbPhoton.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ define( function( require ) {

RGBPhoton.call( this, location, velocity, intensity );

var self = this;

// the "wasWhite" attribute is needed to determine the intensity of a photon passing through the filter.
// White photons passing through must be changed to match the filter color, but keep full intensity.
// Colored photons must loose intensity when passing through the filter.
Expand All @@ -40,7 +42,7 @@ define( function( require ) {
this.passedFilter = false;
tandem.addInstance( this, TSingleBulbPhoton );
this.disposeSingleBulbPhoton = function() {
tandem.removeInstance( this );
tandem.removeInstance( self );
};
}

Expand Down

0 comments on commit 8e43ec1

Please sign in to comment.