Skip to content

Commit

Permalink
fixed a reference that was causing a memory leak, see #88
Browse files Browse the repository at this point in the history
  • Loading branch information
jbphet committed May 12, 2017
1 parent 3b072db commit 6a2eab2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions js/common/view/CoinTermCreatorNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ define( function( require ) {
}
} );

// variables used by the input listener
var createdCoinTermView = null;

// Add the listener that will allow the user to click on this node and create a new coin term, and then position it
// in the model. This works by forwarding the events it receives to the node that gets created in the view.
this.addInputListener( {
Expand Down Expand Up @@ -155,11 +152,14 @@ define( function( require ) {
expressionManipulationModel.addCoinTerm( createdCoinTerm );

// get the view node that should have appeared in the view so that events can be forwarded to its drag handler
createdCoinTermView = expressionManipulationView.getViewForCoinTerm( createdCoinTerm );
var createdCoinTermView = expressionManipulationView.getViewForCoinTerm( createdCoinTerm );
assert && assert( createdCoinTermView, 'unable to find coin term view' );

// forward the event to the view node's drag handler
createdCoinTermView.dragHandler.startDrag( event );
if ( createdCoinTermView ) {

// forward the event to the view node's drag handler
createdCoinTermView.dragHandler.startDrag( event );
}
}
} );
}
Expand Down

0 comments on commit 6a2eab2

Please sign in to comment.