Consolidate cancel code

This commit is contained in:
zhongwuzw 2019-03-19 20:26:00 +08:00
parent ff3a3e827d
commit ebf41a3b01
1 changed files with 3 additions and 2 deletions

View File

@ -263,8 +263,9 @@
@synchronized (self) { @synchronized (self) {
[self.prefetchOperations compact]; [self.prefetchOperations compact];
for (id operation in self.prefetchOperations) { for (id operation in self.prefetchOperations) {
SDAsyncBlockOperation *asyncBlockOperation = operation; if ([operation conformsToProtocol:@protocol(SDWebImageOperation)]) {
[asyncBlockOperation cancel]; [operation cancel];
}
} }
self.prefetchOperations.count = 0; self.prefetchOperations.count = 0;