WeakReference <TestSubscriber <int> > RunLeak() { TestSubscriber <int> ts = new TestSubscriber <int>(1); WeakReference <TestSubscriber <int> > wr = new WeakReference <TestSubscriber <int> >(ts); //Flowable.Range(1, 10) Flowable.Never <int>().Timeout(TimeSpan.FromSeconds(100)) .Subscribe(ts); ts.Cancel(); return(wr); }
WeakReference <TestSubscriber <int> > RunLeak() { TestSubscriber <int> ts = new TestSubscriber <int>(1); WeakReference <TestSubscriber <int> > wr = new WeakReference <TestSubscriber <int> >(ts); Flowable.Range(1, 3).Delay(TimeSpan.FromMilliseconds(1), Executors.Single) .Subscribe(ts); Thread.Sleep(25); ts.Cancel(); return(wr); }