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 { - (void)cancelAll {
@synchronized (self.runningOperations) { @synchronized (self.runningOperations) {
[self.runningOperations makeObjectsPerformSelector:@selector(cancel)]; NSArray *copiedOperations = [self.runningOperations copy];
[self.runningOperations removeAllObjects]; [copiedOperations makeObjectsPerformSelector:@selector(cancel)];
[self.runningOperations removeObjectsInArray:copiedOperations];
} }
} }