From 3587b8d1e0f51710dfd1cec0c3a723048f7473f4 Mon Sep 17 00:00:00 2001 From: Jimmy Lee Date: Thu, 31 Jul 2014 10:10:52 +1000 Subject: [PATCH] fix cancelAll crash --- SDWebImage/SDWebImageManager.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SDWebImage/SDWebImageManager.m b/SDWebImage/SDWebImageManager.m index 2781ec87..e545a84a 100644 --- a/SDWebImage/SDWebImageManager.m +++ b/SDWebImage/SDWebImageManager.m @@ -283,8 +283,9 @@ - (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]; } }