Skip to content

Instantly share code, notes, and snippets.

@andreyfomenkov
Last active December 20, 2020 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreyfomenkov/b08df895e223fc4143add8a50083e58b to your computer and use it in GitHub Desktop.
Save andreyfomenkov/b08df895e223fc4143add8a50083e58b to your computer and use it in GitHub Desktop.
Leaking subscription
class Thermometer {
fun observeTemperature(): Observable<Int>
}
// ...
val thermometer = Thermometer.getInstance()
// ...
thermometer
.observeTemperature()
.subscribe { /* Handle value */ } // Subscribed, but not disposed afterwards!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment