koufa11/26/2017, 9:42 AM
? How do you avoid leaking an
enough to avoid memory leaks?
louiscad11/27/2017, 8:27 AM
, you can assign the
call to a private nullable
property and make the last line of your coroutine set your it back to
(unless you need to or may launch your coroutine multiple times, before the first one is completed). Then, in your `ViewModel`'s
method, you can safe call (with a
property. Of course, the coroutine will be effectively cancelled only if a cancellable suspend method encounters the cancel signal. Also, don't forget to catch the
inside your coroutine.