phetsims / balancing-chemical-equations

"Balancing Chemical Equations" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/balancing-chemical-equations
GNU General Public License v3.0
2 stars 5 forks source link

does Equation needs a dispose method? #142

Closed pixelzoom closed 4 years ago

pixelzoom commented 4 years ago

Game creates 5 of these when level selection button is pressed.

pixelzoom commented 4 years ago

Equation does not currently need dispose. It links to Properties of its reactants and products:

    this.reactants.forEach( reactant => reactant.userCoefficientProperty.lazyLink( observer ) );
    this.products.forEach( product => product.userCoefficientProperty.lazyLink( observer ) );

... but Equation is an abstract base class, and the reactants and products are own owned by the subclasses. So there is no need to call dispose for any instance of Equation.

It will likely need dispose if/when instrumented for PhET-iO.

samreid commented 4 years ago

I detected a TODO for this issue as part of https://github.com/phetsims/chipper/issues/946 and decided to remove the TODO.