JetBrains / jewel

An implementation of the IntelliJ look and feels in Compose for Desktop
Apache License 2.0
636 stars 30 forks source link

Fix crash in CircularProgressIndicator when switching themes #360

Closed rock3r closed 2 months ago

rock3r commented 2 months ago

Fixes #359 by making sure we only have one source of truth when it comes to the number of frames in the indicator.

Having the frame count as a separate state might lead to unfortunate race conditions, where the frames array has changed but the count hasn't yet, causing index out of bounds error. Now, the frames count is only computed when needed, synchronously, in the composition.

I have been furiously switching themes for over a minute and can't make the component crash anymore.