From 5dd677756f045d3437ade2e3e3b8b2e95bebd001 Mon Sep 17 00:00:00 2001 From: Viktor De Pasquale Date: Thu, 20 Jun 2019 19:52:57 +0200 Subject: [PATCH] Fixed multiple fetch tasks running at once Disposing wouldn't help since the shell doesn't appear to handle concurrency well --- .../com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt index ea70e895b..1029d9ace 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt @@ -53,7 +53,7 @@ class SuperuserViewModel( } fun updatePolicies() { - fetchTask?.dispose() + if (fetchTask?.isDisposed?.not() == true) return fetchTask = appRepo.fetchAll() .flattenAsFlowable { it } .map { PolicyRvItem(it, it.applicationInfo.loadIcon(packageManager)) }