Merge pull request #838 from justjimmy/master

fix cancelAll crash (Issue #809)
This commit is contained in:
Bogdan Poplauschi 2014-08-06 19:20:47 +03:00
commit 044abf402d
1 changed files with 3 additions and 2 deletions

View File

@ -282,8 +282,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];
}
}