heldentodd / xray-diffraction

This repository contains the code for one simulation, but eventually three are planned: bragg-law, Single Crystal Diffraction, and Powder Diffraction.
GNU General Public License v3.0
2 stars 1 forks source link

link and unlink relationship in this sim? #29

Closed pixelzoom closed 4 years ago

pixelzoom commented 4 years ago

Related to #1 (code review).

  • [ ] Are there leaks due to registering observers or listeners? The following guidelines should be followed unless there it is obviously no need to unlink, or documentation (in-line or in the implementation nodes)added about why following them is not necessary. Unlink is not needed for Properties contained in classes that are never disposed of, such as primary model and view classes that exist for the duration of the sim.
  • [ ] AXON: Property.link is accompanied by Property.unlink.
  • [ ] AXON: Creation of DerivedProperty is accompanied by dispose.
  • [ ] AXON: Creation of Multilink is accompanied by dispose.
  • [ ] AXON: Emitter.addListener is accompanied by Emitter.removeListener.
  • [ ] TANDEM: PhET-iO instrumented PhetioObject instances should be disposed.

There is no documentation associated with calls to link etc. And I don't see any calls to unlink etc. So either the sim is leaking memory, or it has no need to dispose of instances.

@heldentodd can you clarify how this sim manages memory?

heldentodd commented 4 years ago

I've added comments for all of these. This particular sim sets up all the links and listeners when it first loads and then does not add or remove any after that. I guess this will probably change when this simulation gets split into multiple views.