Closed Lebartodev closed 1 year ago
Hi @Lebartodev we've released a minor and a few patches since your report, in fact we're now at 4.3.2 and we might've fixed the crash you were experiencing. Can you try upgrading to see if that fixes your problem?
Going to close this issue for now - feel free to reopen if the issue is pops up again!
I came across a crash when implementing RecyclerView + Rive. It is easy to reproduce it if you remove the riveResource tag from activity_recycler_item.xml, run RecyclerActivity, scroll down 3-4 items and then return to the beginning.
I think this is because in
onDetachedFromWindow
you callRendererSkia.delete()
, which clears theunsafeCppPointer
forLinearAnimationInstance
( byRendererSkia.disposeDependencies()
). And inonAttachedToWindow
,play(detachedState.playingAnimationsNames,...)
is called with names of LinearAnimationInstance that no longer exist in C++.Caused by: app.rive.runtime.kotlin.core.errors.RiveException: C++ object for app.rive.runtime.kotlin.core.LinearAnimationInstance@6c6335 does not exist. See MEMORY_MANAGEMENT.md for more information. at app.rive.runtime.kotlin.core.NativeObject.getCppPointer(NativeOwner.kt:24) at app.rive.runtime.kotlin.core.LinearAnimationInstance.getName(LinearAnimationInstance.kt:141) at app.rive.runtime.kotlin.RiveArtboardRenderer._animations(RiveArtboardRenderer.kt:395) at app.rive.runtime.kotlin.RiveArtboardRenderer._animations(RiveArtboardRenderer.kt:386) at app.rive.runtime.kotlin.RiveArtboardRenderer._playAnimation(RiveArtboardRenderer.kt:430) at app.rive.runtime.kotlin.RiveArtboardRenderer.play(RiveArtboardRenderer.kt:217) at app.rive.runtime.kotlin.RiveAnimationView.play(RiveAnimationView.kt:356) at app.rive.runtime.kotlin.RiveAnimationView.play$default(RiveAnimationView.kt:349) at app.rive.runtime.kotlin.RiveAnimationView.onAttachedToWindow(RiveAnimationView.kt:537)
Version: 4.2.1