By now, it has become crystal clear that Subscriptions have to be cleaned up because they will cause memory and thread leaks otherwise.
In this section, we will explore a few different ways to correctly destroy Subscriptions. One of the simplest options would be to use the Disposable interface. In addition to that, we will see how the RxLifecycle library can be used to make lifecycle management almost automatic, and we will check out a few examples of how to do that.
Finally, not every Subscription needs to be canceled or destroyed manually. Consider that it is just a simple call, as follows:
Here, we can be sure that it will quickly complete, and it will terminate automatically. ...