RefCount

open class RefCount<T>(object: T?)

Manages reference counting for a given object. Extensions can override .release to do custom logic when reference counting hits 0.

Constructors

Link copied to clipboard
constructor(object: T?)

Functions

Link copied to clipboard
fun decRef()

Decrements the reference counting of this object. When reference counting hits 0, calls .release.

Link copied to clipboard
fun get(): T?
Link copied to clipboard

Returns the current reference count.

Link copied to clipboard
fun incRef()

Increments the reference count. Calls to this method must be matched with calls to .decRef.