I'm learning RxJava and I noticed a lot of the sample code does a isDisposed()
check before calling dispose()
. I did not notice any issues when I called dispose()
on an already disposed Disposable
.
So my question is, do I need the isDisposed()
check? Are there situations where I should check isDisposed()
before disposing? What are the pros and cons on doing the check first?
isDisposed
before callingonNext
and why? -- I've found code which calls it every time when usingSingle.create
etc. , is it possible to abuse a single in any way to make it be disposed and then try to make it emit something? What happens if you don't check forisDisposed
in these cases? – Osman