Skip to content

Commit 3c75308

Browse files
committed
fix: AVCacheManager's getter of diskCachePath is not safe
1 parent b5cdf84 commit 3c75308

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

AVOS/AVOSCloud/Cache/AVCacheManager.m

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ - (instancetype)init {
3838
self = [super init];
3939
if (self) {
4040
_cacheQueue = dispatch_queue_create("avos.paas.cacheQueue", DISPATCH_QUEUE_SERIAL);
41+
_diskCachePath = [AVCacheManager path];
4142
}
4243
return self;
4344
}
@@ -47,13 +48,6 @@ + (NSString *)path {
4748
return [AVPersistenceUtils avCacheDirectory];
4849
}
4950

50-
- (NSString *)diskCachePath {
51-
if (!_diskCachePath) {
52-
_diskCachePath = [AVCacheManager path];
53-
}
54-
return _diskCachePath;
55-
}
56-
5751
- (NSString *)pathForKey:(NSString *)key {
5852
return [self.diskCachePath stringByAppendingPathComponent:key];
5953
}

0 commit comments

Comments
 (0)