fix cancelAll crash

This commit is contained in:
Jimmy Lee 2014-07-31 10:10:52 +10:00
parent 2eef774eae
commit 3587b8d1e0
1 changed files with 3 additions and 2 deletions

View File

@ -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];
}
}