rive-app / rive-android

A runtime for interactive animations on Android
https://rive.app
MIT License
332 stars 30 forks source link

race conditions accessing animations #237

Closed mjtalbot closed 2 years ago

mjtalbot commented 2 years ago

Two issues were identified

Fatal Exception: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
       at java.util.ArrayList.get(ArrayList.java:437)
       at kotlin.collections.CollectionsKt___CollectionsKt.toList(_Collections.kt:1313)
       at app.rive.runtime.kotlin.RiveArtboardRenderer.advance(RiveArtboardRenderer.kt:53)

&

Fatal Exception: java.util.ConcurrentModificationException
       at java.util.HashMap$HashIterator.nextNode(HashMap.java:1441)
       at java.util.HashMap$KeyIterator.next(HashMap.java:1465)
       at kotlin.collections.CollectionsKt___CollectionsKt.mapTo(CollectionsKt___CollectionsKt.java:1618)
       at app.rive.runtime.kotlin.RiveAnimationView.onDetachedFromWindow(RiveAnimationView.kt:634)
       at android.view.View.dispatchDetachedFromWindow(View.java:20786)
       at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3963)
       at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3963)
       at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3963)
       at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3963)
       at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3963)
       at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3963)
       at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5641)
       at android.view.ViewGroup.removeViewAt(ViewGroup.java:5588)
       at androidx.recyclerview.widget.RecyclerView$5.removeViewAt(RecyclerView.java:882)