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
Scenery currently only removes listeners from color properties used as fill/stroke during a Display.updateDisplay() (called during sim steps).
This can create issues with the new listener pattern if something like the following is done:
varcolorProperty=newaxon.Property('blue');scene.addChild(newscenery.Circle(10,{fill: colorProperty}));display.updateDisplay();scene.removeAllChildren();colorProperty.dispose();// Assertion failed: tried to removeListener on something that wasn't a listenerdisplay.updateDisplay();
It would be good to discuss if this is a complication we should get used to, or if there is a way of properly handling it, e.g.:
Be able to listen to when a property is disposed, so that we can remove the listener.
Check if the listener exists when trying to remove it (seems like it could allow unintended bugs to be introduced, but is the highest-performance option).
Have Scenery try to synchronously remove the listener. This would be a 300+ LOC change with a good amount of complexity AND a performance hit, so I'd prefer not to do this.
Thoughts?
The text was updated successfully, but these errors were encountered:
Scenery currently only removes listeners from color properties used as fill/stroke during a
Display.updateDisplay()
(called during sim steps).This can create issues with the new listener pattern if something like the following is done:
It would be good to discuss if this is a complication we should get used to, or if there is a way of properly handling it, e.g.:
Thoughts?
The text was updated successfully, but these errors were encountered: