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) {
[self.prefetchOperations compact];
for (id operation in self.prefetchOperations) {
SDAsyncBlockOperation *asyncBlockOperation = operation;
[asyncBlockOperation cancel];
if ([operation conformsToProtocol:@protocol(SDWebImageOperation)]) {
[operation cancel];
}
}
self.prefetchOperations.count = 0;