mirror of
https://git.mihon.tech/mihonapp/mihon
synced 2024-11-25 06:36:00 +03:00
Fix ChapterCache.isImageInCache() resource leak (#8907)
diskCache.get() returns a DiskLruCache.Snapshot which must be closed.
This commit is contained in:
parent
b6468c7e31
commit
8cea78de83
1 changed files with 1 additions and 1 deletions
|
@ -128,7 +128,7 @@ class ChapterCache(private val context: Context) {
|
|||
*/
|
||||
fun isImageInCache(imageUrl: String): Boolean {
|
||||
return try {
|
||||
diskCache.get(DiskUtil.hashKeyForDisk(imageUrl)) != null
|
||||
diskCache.get(DiskUtil.hashKeyForDisk(imageUrl)).use { it != null }
|
||||
} catch (e: IOException) {
|
||||
false
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue