StableRef

value class StableRef<out T : Any>(source)

This class provides a way to create a stable handle to any Kotlin object. After converting to CPointer it can be safely passed to native code e.g. to be received in a Kotlin callback.

Any StableRef should be manually disposed

Since Kotlin

1.3

Types

Link copied to clipboard
object Companion
Since Kotlin 1.3

Properties

Link copied to clipboard
Since Kotlin 1.3

Functions

Link copied to clipboard

Converts the handle to C pointer.

Since Kotlin 1.3
Link copied to clipboard
fun dispose()

Disposes the handle. It must not be used after that.

Since Kotlin 1.3
Link copied to clipboard
fun get(): T

Returns the object this handle was created for.

Since Kotlin 1.3