8000 [AFImageDownloader defaultURLCache] is broken and can exceed disk cache limit by congsun · Pull Request #4737 · AFNetworking/AFNetworking · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Jan 17, 2023. It is now read-only.

[AFImageDownloader defaultURLCache] is broken and can exceed disk cache limit #4737

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions UIKit+AFNetworking/AFImageDownloader.m
Original file line number Diff line number Diff line change
Expand Up @@ -111,21 +111,21 @@ @implementation AFImageDownloader
+ (NSURLCache *)defaultURLCache {
NSUInteger memoryCapacity = 20 * 1024 * 1024; // 20MB
NSUInteger diskCapacity = 150 * 1024 * 1024; // 150MB
NSString *diskPath = @"com.alamofire.imagedownloader";
#if TARGET_OS_MACCATALYST
NSURL *cacheURL = [[[NSFileManager defaultManager] URLForDirectory:NSCachesDirectory
inDomain:NSUserDomainMask
appropriateForURL:nil
create:YES
error:nil]
URLByAppendingPathComponent:@"com.alamofire.imagedownloader"];

#if TARGET_OS_MACCATALYST
URLByAppendingPathComponent:diskPath];
return [[NSURLCache alloc] initWithMemoryCapacity:memoryCapacity
diskCapacity:diskCapacity
directoryURL:cacheURL];
#else
return [[NSURLCache alloc] initWithMemoryCapacity:memoryCapacity
diskCapacity:diskCapacity
diskPath:[cacheURL path]];
diskPath:diskPath];
#endif
}

Expand Down
0