Skip to content

Commit

Permalink
fix:cancelAllRequest crash
Browse files Browse the repository at this point in the history
  • Loading branch information
garenwang committed May 30, 2022
1 parent cace0eb commit 21c00f4
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,9 @@ - (void)cancelAllRequest {
NSEnumerator *enumertor = [_taskQueue objectEnumerator];
NSURLSessionTask *task = nil;
while (task = [enumertor nextObject]) {
[task cancel];
if ([task respondsToSelector:@selector(cancel)]) {
[task cancel];
}
}
[_taskQueue removeAllObjects];
}
Expand Down

0 comments on commit 21c00f4

Please sign in to comment.