From ed93f4a6c16ab5c173738e94b0b682b2ef50221a Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 12 Sep 2019 17:17:54 +0200 Subject: [PATCH] Cancel any request properly --- .../riotx/features/roomdirectory/RoomDirectoryViewModel.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vector/src/main/java/im/vector/riotx/features/roomdirectory/RoomDirectoryViewModel.kt b/vector/src/main/java/im/vector/riotx/features/roomdirectory/RoomDirectoryViewModel.kt index 89af5330ca..456ea23834 100644 --- a/vector/src/main/java/im/vector/riotx/features/roomdirectory/RoomDirectoryViewModel.kt +++ b/vector/src/main/java/im/vector/riotx/features/roomdirectory/RoomDirectoryViewModel.kt @@ -226,4 +226,9 @@ class RoomDirectoryViewModel @AssistedInject constructor(@Assisted initialState: }) } + override fun onCleared() { + super.onCleared() + + currentTask?.cancel() + } } \ No newline at end of file