You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@AgustinVallejo and I are finding discrepancies about how it is best to dispose SoundGenerators (while working on phetsims/scenery-phet#849). Looking at usages of soundManager.removeSoundGenerator, most are calling dispose on the soundGenerator right there (and the others seem like they likely should be).
We were brainstorming a couple of more automated ways of handling this.
Perhaps like calling removeSoundGenerator (with grace) from the disposal of SoundGenerator automatically.
Or having addSoundGenerator hook into the disposal of the soundGenerator to auto remove (then that listener is removed if removeSoundGenerator is called without disposing).
I'd start by looking at the 17 usages of removeSoundGenerator() to see if this is really the pattern we want to propagate across the project. Can't the library support this internally?
@jbphet if you give me some direction I'm happy to take a look at implementing.
@AgustinVallejo and I are finding discrepancies about how it is best to dispose SoundGenerators (while working on phetsims/scenery-phet#849). Looking at usages of
soundManager.removeSoundGenerator
, most are calling dispose on the soundGenerator right there (and the others seem like they likely should be).We were brainstorming a couple of more automated ways of handling this.
I'd start by looking at the 17 usages of removeSoundGenerator() to see if this is really the pattern we want to propagate across the project. Can't the library support this internally?
@jbphet if you give me some direction I'm happy to take a look at implementing.
For example for our new RichKeyboardDragListener:
https://github.com/phetsims/scenery-phet/blob/355d4de45aeeecea3d0537b80af0adcccc848060/js/RichKeyboardDragListener.ts#L88-L99
The text was updated successfully, but these errors were encountered: