Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Coroutines Interop] Dispose the handle returned by `Job.invokeOnComp…
…letion` when Rx subscription is disposed. (#470) The `Completable` `emitter` is captured by the `Job.invokeOnCompletion` closure (`CompletionHandler`), so if we don't dispose the handler when Rx subscription is disposed, we are holding onto a reference to `CompletableEmitter` until the job is completed (and the handler is called and disposed). Calling the handler after the subscription is disposed is not an issue, because `CompletableEmitter.onError` and `CompletableEmitter.onComplete` checks for disposal before taking any action -- but it stills presents a potential memory leak.
- Loading branch information