1
0
mirror of https://github.com/mihonapp/mihon.git synced 2025-08-13 01:51:32 +02:00

Fix ChapterCache.isImageInCache() resource leak ()

diskCache.get() returns a DiskLruCache.Snapshot which must be closed.
This commit is contained in:
Two-Ai
2023-01-13 22:30:26 -05:00
committed by GitHub
parent b6468c7e31
commit 8cea78de83

@@ -128,7 +128,7 @@ class ChapterCache(private val context: Context) {
*/ */
fun isImageInCache(imageUrl: String): Boolean { fun isImageInCache(imageUrl: String): Boolean {
return try { return try {
diskCache.get(DiskUtil.hashKeyForDisk(imageUrl)) != null diskCache.get(DiskUtil.hashKeyForDisk(imageUrl)).use { it != null }
} catch (e: IOException) { } catch (e: IOException) {
false false
} }