Merge branch 'master' into 5.x
This commit is contained in:
commit
957de6d70f
|
@ -30,7 +30,7 @@ static id<SDImageLoader> _defaultImageLoader;
|
|||
@property (strong, nonatomic, readwrite, nonnull) id<SDImageLoader> imageLoader;
|
||||
@property (strong, nonatomic, nonnull) NSMutableSet<NSURL *> *failedURLs;
|
||||
@property (strong, nonatomic, nonnull) dispatch_semaphore_t failedURLsLock; // a lock to keep the access to `failedURLs` thread-safe
|
||||
@property (strong, nonatomic, nonnull) NSMutableArray<SDWebImageCombinedOperation *> *runningOperations;
|
||||
@property (strong, nonatomic, nonnull) NSMutableSet<SDWebImageCombinedOperation *> *runningOperations;
|
||||
@property (strong, nonatomic, nonnull) dispatch_semaphore_t runningOperationsLock; // a lock to keep the access to `runningOperations` thread-safe
|
||||
|
||||
@end
|
||||
|
@ -86,7 +86,7 @@ static id<SDImageLoader> _defaultImageLoader;
|
|||
_imageLoader = loader;
|
||||
_failedURLs = [NSMutableSet new];
|
||||
_failedURLsLock = dispatch_semaphore_create(1);
|
||||
_runningOperations = [NSMutableArray new];
|
||||
_runningOperations = [NSMutableSet new];
|
||||
_runningOperationsLock = dispatch_semaphore_create(1);
|
||||
}
|
||||
return self;
|
||||
|
@ -165,7 +165,7 @@ static id<SDImageLoader> _defaultImageLoader;
|
|||
|
||||
- (void)cancelAll {
|
||||
LOCK(self.runningOperationsLock);
|
||||
NSArray<SDWebImageCombinedOperation *> *copiedOperations = [self.runningOperations copy];
|
||||
NSSet<SDWebImageCombinedOperation *> *copiedOperations = [self.runningOperations copy];
|
||||
UNLOCK(self.runningOperationsLock);
|
||||
[copiedOperations makeObjectsPerformSelector:@selector(cancel)]; // This will call `safelyRemoveOperationFromRunning:` and remove from the array
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue