RefCountDisposable

Constructors

this
this(Disposable disposable, bool throwWhenDisposed = false)

Members

Functions

dispose
void dispose()
getDisposable
Disposable getDisposable()

Inherited Members

From Disposable

dispose
void dispose()

Examples

1 bool disposed = false;
2 auto disposable = new RefCountDisposable(new AnonymousDisposable({
3         disposed = true;
4     }));
5 
6 auto subscription = disposable.getDisposable();
7 
8 assert(!disposed);
9 disposable.dispose();
10 assert(!disposed);
11 
12 subscription.dispose();
13 assert(disposed);