jenius-apps / ambie

An app that uses white noise, nature sounds, and focus features to boost your productivity.
https://ambieapp.com
MIT License
1.89k stars 143 forks source link

Fix ObjectDisposedException-s when toggling shaders #378

Closed Sergio0694 closed 8 months ago

Sergio0694 commented 1 year ago

Closes #377

This PR re-enables the animated shaders and fixes a crash that could happen on some devices when toggling between different animated shaders. I've left detailed notes in the comments added in this PR, but TLDR the issue was causing by the property changed handler for the viewmodel changing the shader effect in use and disposing the old one, concurrently with the rendering thread for the Win2D canvas rendering frames. So in some cases, the effect being drawn would be disposed, and fail.