From b18c155e22fb77da9c74d75d0744c7cb7017fdd6 Mon Sep 17 00:00:00 2001 From: Mitchell Syer Date: Mon, 19 Feb 2024 11:06:13 -0500 Subject: [PATCH] Fix Downloader Memory Leak (#880) --- .../manga/impl/download/fileProvider/ChaptersFilesProvider.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/download/fileProvider/ChaptersFilesProvider.kt b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/download/fileProvider/ChaptersFilesProvider.kt index cfe567d37..03682eb6f 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/download/fileProvider/ChaptersFilesProvider.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/download/fileProvider/ChaptersFilesProvider.kt @@ -53,7 +53,7 @@ abstract class ChaptersFilesProvider(val mangaId: Int, val chapterId: Int) : Dow step(null, false) // don't throw on canceled download here since we can't do anything } .launchIn(scope) - } + }.first.close() } finally { // always cancel the page progress job even if it throws an exception to avoid memory leaks pageProgressJob?.cancel()