RefCounted

interface RefCounted

An interface for reference-counted objects. Can be used with RCPointer by delegation.

Inheritors

Properties

Link copied to clipboard
abstract val isDisposed: Boolean

Whether this object has been disposed due to the reference count reaching 0.

Link copied to clipboard
abstract val refCount: Int

The current reference count.

Functions

Link copied to clipboard
abstract fun acquire(source: String)

Acquire a reference. Must be balanced with a call to release.

Link copied to clipboard
abstract fun release(source: String, reason: String = "")

Release a reference. When the last reference is released, the object is disposed.