mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-04 08:08:55 +01:00 
			
		
		
		
	Fix ChapterCache.isImageInCache() resource leak (#8907)
diskCache.get() returns a DiskLruCache.Snapshot which must be closed.
This commit is contained in:
		@@ -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
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user