summaryrefslogtreecommitdiffhomepage
path: root/android/src
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2021-01-20 20:57:50 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2021-03-31 14:36:30 +0000
commit0c1b8060860f8917e031a48d6a271f847a51b4b0 (patch)
tree2f5ab491ebf0bf1ee50f54ff4accee2bcac97fd4 /android/src
parent23bc35b295504c76d3f1681294ecea71e40e7454 (diff)
downloadmullvadvpn-0c1b8060860f8917e031a48d6a271f847a51b4b0.tar.xz
mullvadvpn-0c1b8060860f8917e031a48d6a271f847a51b4b0.zip
Unsubscribe listeners in `AccountCache.onDestroy`
Diffstat (limited to 'android/src')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/service/AccountCache.kt4
1 files changed, 4 insertions, 0 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/AccountCache.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/AccountCache.kt
index d4f6d9501b..2bc50ab461 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/AccountCache.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/AccountCache.kt
@@ -105,6 +105,10 @@ class AccountCache(val daemon: MullvadDaemon, val settingsListener: SettingsList
fun onDestroy() {
settingsListener.accountNumberNotifier.unsubscribe(this)
jobTracker.cancelAllJobs()
+
+ onAccountNumberChange.unsubscribeAll()
+ onAccountExpiryChange.unsubscribeAll()
+ onAccountHistoryChange.unsubscribeAll()
}
private fun fetchAccountHistory() {