From df470fcb2a19ed9b5aa684b8920f6f029baaf024 Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 3 Dec 2019 19:12:40 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/service/DownloadService.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/service/DownloadService.kt b/app/src/main/java/io/legado/app/service/DownloadService.kt index d1c45a15b..6948259a3 100644 --- a/app/src/main/java/io/legado/app/service/DownloadService.kt +++ b/app/src/main/java/io/legado/app/service/DownloadService.kt @@ -40,12 +40,13 @@ class DownloadService : BaseService() { override fun onDestroy() { super.onDestroy() + tasks.clear() searchPool.close() } private fun download(bookUrl: String?, start: Int, end: Int) { if (bookUrl == null) return - val task = Coroutine.async { + val task = Coroutine.async(this) { val book = App.db.bookDao().getBook(bookUrl) ?: return@async val bookSource = App.db.bookSourceDao().getBookSource(book.origin) ?: return@async val webBook = WebBook(bookSource)