Skip to content

Commit

Permalink
fix cancelAll crash (Issue #809)
Browse files Browse the repository at this point in the history
  • Loading branch information
Toshinari Nakamura committed Aug 4, 2014
1 parent 5667e9f commit 94274ba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions SDWebImage/SDWebImageManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}

Expand Down

0 comments on commit 94274ba

Please sign in to comment.