Fix downloader memory leak (#418)

This commit is contained in:
Mitchell Syer
2022-10-11 05:22:10 -04:00
committed by GitHub
parent 7ae837ca3c
commit f2d1c6e3cb
@@ -52,7 +52,7 @@ class Downloader(private val downloadQueue: CopyOnWriteArrayList<DownloadChapter
val pageCount = download.chapter.pageCount
for (pageNum in 0 until pageCount) {
runBlocking { getPageImage(download.mangaId, download.chapterIndex, pageNum) }
runBlocking { getPageImage(download.mangaId, download.chapterIndex, pageNum) }.first.close()
// TODO: retry on error with 2,4,8 seconds of wait
// TODO: download multiple pages at once, possible solution: rx observer's strategy is used in Tachiyomi
// TODO: fine grained download percentage