mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Fix ChapterCache.isImageInCache() resource leak (#8907)
diskCache.get() returns a DiskLruCache.Snapshot which must be closed.
This commit is contained in:
parent
3206ef825e
commit
8ab47139f2
1 changed files with 1 additions and 1 deletions
|
@ -181,7 +181,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…
Add table
Add a link
Reference in a new issue