pull/36/head
kunfei 5 years ago
parent 86a99da671
commit 8d7bdb3ad1
  1. 4
      app/src/main/java/io/legado/app/ui/book/search/SearchViewModel.kt
  2. 2
      app/src/main/java/io/legado/app/ui/changesource/ChangeSourceViewModel.kt

@ -9,7 +9,6 @@ import io.legado.app.help.coroutine.Coroutine
import io.legado.app.model.WebBook import io.legado.app.model.WebBook
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.asCoroutineDispatcher import kotlinx.coroutines.asCoroutineDispatcher
import kotlinx.coroutines.cancel
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
import java.util.concurrent.Executors import java.util.concurrent.Executors
@ -55,7 +54,6 @@ class SearchViewModel(application: Application) : BaseViewModel(application) {
} }
fun stop() { fun stop() {
searchPool.cancel()
task?.cancel() task?.cancel()
} }
@ -82,7 +80,7 @@ class SearchViewModel(application: Application) : BaseViewModel(application) {
} }
override fun onCleared() { override fun onCleared() {
searchPool.close()
super.onCleared() super.onCleared()
searchPool.close()
} }
} }

@ -135,7 +135,7 @@ class ChangeSourceViewModel(application: Application) : BaseViewModel(applicatio
} }
override fun onCleared() { override fun onCleared() {
searchPool.close()
super.onCleared() super.onCleared()
searchPool.close()
} }
} }
Loading…
Cancel
Save