Skip to content

Crash! app.rive.runtime.kotlin.core.errors.RiveException: Accessing disposed C++ object RiveArtboardRenderer. #424

@YvgenTroshchiy

Description

@YvgenTroshchiy

Steps to reproduce:
LazyColumn inside each row button with rive.
Quite fast scroll up/down for few seconds.

And we have get a this crash. We are trying to riveView?.pause()/stop - just in case. clear all references. by onRelease. listItem.onRelease = { } do dispose , don't do dispose but still get this crash.

AndroidRuntime                  E  FATAL EXCEPTION: Thread-15
                                   Process: com.letyco, PID: 27929
                                   java.lang.Throwable: 
                                   app.rive.runtime.kotlin.core.errors.RiveException: Accessing disposed C++ object RiveArtboardRenderer.
                                       app.rive.runtime.kotlin.core.NativeObject.getCppPointer(NativeObject.kt:55)
                                       app.rive.runtime.kotlin.renderers.Renderer.getWidth(Renderer.kt:215)
                                       app.rive.runtime.kotlin.renderers.RiveArtboardRenderer.resizeArtboard(RiveArtboardRenderer.kt:36)
                                       app.rive.runtime.kotlin.renderers.RiveArtboardRenderer.draw(RiveArtboardRenderer.kt:51)
InputDispatcher                 E  channel 'b67e987 com.letyco/com.letyco.MainActivity' ~ Channel is unrecoverably broken and will be disposed!

You can just create empty LazaColumn. So I've added just empty RiveAnimationView and there no crash and only I uncomment. resId = style.type.resId, I've got crash by fast scroll. I event disabled rive VM. so there only empty view.
Also trying dispose in many ways this view but still get the crash.

        AndroidView(
            modifier = modifier,
            factory = { context ->

                val riveView = RiveAnimationView(context).apply {
                    // setRiveResource(
                    //     resId = style.type.resId,
                    //     // fit = Fit.LAYOUT,
                    //     stateMachineName = "boost-animation",
                    //     autoplay = false,
                    //     autoBind = false,
                    // )
                    // riveController.init(this, model)
                }
                riveView

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions