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);