RefCountDisposable

Constructors

this
this(Disposable disposable, bool throwWhenDisposed)

Members

Functions

dispose
void dispose()
getDisposable
Disposable getDisposable()

Inherited Members

From Disposable

dispose
void dispose()

Examples

bool disposed = false;
auto disposable = new RefCountDisposable(new AnonymousDisposable({
        disposed = true;
    }));

auto subscription = disposable.getDisposable();

assert(!disposed);
disposable.dispose();
assert(!disposed);

subscription.dispose();
assert(disposed);

Meta