|
|
@@ -46,12 +46,17 @@ typedef NSMapTable<NSString *, id<SDWebImageOperation>> SDOperationsDictionary;
|
|
|
// Cancel in progress downloader from queue
|
|
|
SDOperationsDictionary *operationDictionary = [self sd_operationDictionary];
|
|
|
id<SDWebImageOperation> operation;
|
|
|
+
|
|
|
@synchronized (self) {
|
|
|
operation = [operationDictionary objectForKey:key];
|
|
|
- [operationDictionary removeObjectForKey:key];
|
|
|
}
|
|
|
- if ([operation conformsToProtocol:@protocol(SDWebImageOperation)]) {
|
|
|
- [operation cancel];
|
|
|
+ if (operation) {
|
|
|
+ if ([operation conformsToProtocol:@protocol(SDWebImageOperation)]) {
|
|
|
+ [operation cancel];
|
|
|
+ }
|
|
|
+ @synchronized (self) {
|
|
|
+ [operationDictionary removeObjectForKey:key];
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|