Skip to content

Commit

Permalink
revise dispose descriptions in implementation-notes.md, phetsims/axon…
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Jul 5, 2023
1 parent cad1d03 commit 7f85825
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions doc/implementation-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ The transform between model and view coordinate frames can be found in [Graph](h
### Memory Management
The dynamic objects in the sim are the vectors, and their model and view classes implement `dispose`. On the model side, that includes [RootVector](https://github.com/phetsims/vector-addition/blob/master/js/common/model/RootVector.js) and its subclasses; on the view side, [RootVectorNode](https://github.com/phetsims/vector-addition/blob/master/js/common/view/RootVectorNode.js) and its subclasses.

All other objects are instantiated at startup, and exist for the lifetime of the sim. Classes that are not intended (and in fact, not designed) to be disposed have a `dispose` method that fails an assertion if called. For example:
All other objects are instantiated at startup, and exist for the lifetime of the sim. They are created with `isDisposable: false`, or have a `dispose` method that looks like this:

```ts
public override dispose(): void {
public dispose(): void {
Disposable.assertNotDisposable();
super.dispose();
}
```

Expand Down

0 comments on commit 7f85825

Please sign in to comment.