Skip to main content

RefCounted

Inherits: Object

Description

Base class for reference-counted objects. RefCounted instances keep an internal reference counter so that they are automatically released when no longer in use.

Inheritance

RefCounted < Object

Methods

get_reference_count

Returns the current reference count.

init_ref

Initializes the internal reference counter. Use this only if you really know what you are doing.

reference

Increments the internal reference counter. Returns true if successful.

unreference

Decrements the internal reference counter. Returns true if the object should be freed after the decrement.

Example Usage