diff --git a/SDWebImage/SDWebImageManager.m b/SDWebImage/SDWebImageManager.m index 2781ec8..e545a84 100644 --- a/SDWebImage/SDWebImageManager.m +++ b/SDWebImage/SDWebImageManager.m @@ -283,8 +283,9 @@ - (void)saveImageToCache:(UIImage *)image forURL:(NSURL *)url { - (void)cancelAll { @synchronized (self.runningOperations) { - [self.runningOperations makeObjectsPerformSelector:@selector(cancel)]; - [self.runningOperations removeAllObjects]; + NSArray *copiedOperations = [self.runningOperations copy]; + [copiedOperations makeObjectsPerformSelector:@selector(cancel)]; + [self.runningOperations removeObjectsInArray:copiedOperations]; } }