diff --git a/vector/src/main/java/im/vector/app/features/crypto/verification/choose/VerificationChooseMethodViewModel.kt b/vector/src/main/java/im/vector/app/features/crypto/verification/choose/VerificationChooseMethodViewModel.kt index e309869479..4518a8d6b7 100644 --- a/vector/src/main/java/im/vector/app/features/crypto/verification/choose/VerificationChooseMethodViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/crypto/verification/choose/VerificationChooseMethodViewModel.kt @@ -89,8 +89,8 @@ class VerificationChooseMethodViewModel @AssistedInject constructor( } override fun onCleared() { - super.onCleared() session.cryptoService().verificationService().removeListener(this) + super.onCleared() } companion object : MvRxViewModelFactory { diff --git a/vector/src/main/java/im/vector/app/features/discovery/DiscoverySettingsViewModel.kt b/vector/src/main/java/im/vector/app/features/discovery/DiscoverySettingsViewModel.kt index 0f294e080a..d16ebcdc8b 100644 --- a/vector/src/main/java/im/vector/app/features/discovery/DiscoverySettingsViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/discovery/DiscoverySettingsViewModel.kt @@ -93,8 +93,8 @@ class DiscoverySettingsViewModel @AssistedInject constructor( } override fun onCleared() { - super.onCleared() stopListenToIdentityManager() + super.onCleared() } override fun handle(action: DiscoverySettingsAction) { diff --git a/vector/src/main/java/im/vector/app/features/login/LoginViewModel.kt b/vector/src/main/java/im/vector/app/features/login/LoginViewModel.kt index 666bd21add..a3f1c36d08 100644 --- a/vector/src/main/java/im/vector/app/features/login/LoginViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/login/LoginViewModel.kt @@ -810,9 +810,8 @@ class LoginViewModel @AssistedInject constructor( } override fun onCleared() { - super.onCleared() - currentTask?.cancel() + super.onCleared() } fun getInitialHomeServerUrl(): String? { diff --git a/vector/src/main/java/im/vector/app/features/roomdirectory/RoomDirectoryViewModel.kt b/vector/src/main/java/im/vector/app/features/roomdirectory/RoomDirectoryViewModel.kt index c58e255bcc..b047b2ede9 100644 --- a/vector/src/main/java/im/vector/app/features/roomdirectory/RoomDirectoryViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/roomdirectory/RoomDirectoryViewModel.kt @@ -221,7 +221,7 @@ class RoomDirectoryViewModel @AssistedInject constructor(@Assisted initialState: } override fun onCleared() { - super.onCleared() currentTask?.cancel() + super.onCleared() } } diff --git a/vector/src/main/java/im/vector/app/features/signout/soft/SoftLogoutViewModel.kt b/vector/src/main/java/im/vector/app/features/signout/soft/SoftLogoutViewModel.kt index f1d9a66342..81ac1dbd54 100644 --- a/vector/src/main/java/im/vector/app/features/signout/soft/SoftLogoutViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/signout/soft/SoftLogoutViewModel.kt @@ -232,8 +232,7 @@ class SoftLogoutViewModel @AssistedInject constructor( } override fun onCleared() { - super.onCleared() - currentTask?.cancel() + super.onCleared() } } diff --git a/vector/src/main/java/im/vector/app/features/workers/signout/ServerBackupStatusViewModel.kt b/vector/src/main/java/im/vector/app/features/workers/signout/ServerBackupStatusViewModel.kt index 48f83b6c54..68f62cffe5 100644 --- a/vector/src/main/java/im/vector/app/features/workers/signout/ServerBackupStatusViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/workers/signout/ServerBackupStatusViewModel.kt @@ -157,8 +157,8 @@ class ServerBackupStatusViewModel @AssistedInject constructor(@Assisted initialS } override fun onCleared() { - super.onCleared() session.cryptoService().keysBackupService().removeListener(this) + super.onCleared() } override fun onStateChange(newState: KeysBackupState) { diff --git a/vector/src/main/java/im/vector/app/features/workers/signout/SignoutCheckViewModel.kt b/vector/src/main/java/im/vector/app/features/workers/signout/SignoutCheckViewModel.kt index 48426be723..8a1055e780 100644 --- a/vector/src/main/java/im/vector/app/features/workers/signout/SignoutCheckViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/workers/signout/SignoutCheckViewModel.kt @@ -107,8 +107,8 @@ class SignoutCheckViewModel @AssistedInject constructor(@Assisted initialState: } override fun onCleared() { - super.onCleared() session.cryptoService().keysBackupService().removeListener(this) + super.onCleared() } override fun onStateChange(newState: KeysBackupState) {