Closed mddrill closed 4 years ago
The library is not aware of the android lifecycle events, so you need to clear the resources to avoid any possible leak.
Instead of the custom scope, you can use the viewModelScope
provided by the viewmodel-ktx
.
I've just updated the sample with that -> https://github.com/prof18/RSS-Parser/commit/2ae7c189003d4c83222529a8e223d594b083dc70
In the viewmodel in the kotlin example, I see this code:
I'm trying to figure out why that viewModelJob is needed.
I see you're canceling the job when the viewmodel lifecycle ends. Will memory leaks happen if I use this library and forget to do that? If so, it might be nice to incorporate that behavior into the library somehow.