Last active
December 20, 2020 18:09
-
-
Save andreyfomenkov/b08df895e223fc4143add8a50083e58b to your computer and use it in GitHub Desktop.
Leaking subscription
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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