Skip to content

Commit

Permalink
Memory leak fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed Mar 27, 2018
1 parent 844e80d commit b78fc2d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/MutableOptionsNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ define( function( require ) {
// Have our copies inherit directly (for now, use Reflect.construct when IE11 support is dropped?)
inherit( nodeSubtype, this._type );

// Make a copy, and replace it when one of our dyanmic options changes.
Property.multilink( _.values( dynamicOptions ), this.replaceCopy.bind( this ) );
// @private {Multilink} - Make a copy, and replace it when one of our dyanmic options changes.
this.multilink = Property.multilink( _.values( dynamicOptions ), this.replaceCopy.bind( this ) );

// Apply any options that make more sense on the wrapper (typically like positioning)
this.mutate( wrapperOptions );
Expand Down Expand Up @@ -116,6 +116,7 @@ define( function( require ) {
* Handles disposal.
*/
dispose: function() {
this.multilink.dispose();
this.disposeCopy( this.nodeProperty.value );
this.nodeProperty.dispose();
Node.prototype.dispose.call( this );
Expand Down

0 comments on commit b78fc2d

Please sign in to comment.