Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

does Equation needs a dispose method? #142

Closed
pixelzoom opened this issue Nov 10, 2019 · 2 comments
Closed

does Equation needs a dispose method? #142

pixelzoom opened this issue Nov 10, 2019 · 2 comments

Comments

@pixelzoom
Copy link
Contributor

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

pixelzoom added a commit that referenced this issue Nov 10, 2019
@pixelzoom
Copy link
Contributor Author

pixelzoom commented Apr 16, 2020

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 added a commit that referenced this issue May 21, 2020
@samreid
Copy link
Member

samreid commented May 21, 2020

I detected a TODO for this issue as part of phetsims/chipper#946 and decided to remove the TODO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants