Authored by DreamPiggy
Committed by GitHub

Merge pull request #2196 from dreampiggy/fix_prefetcher_recursion_stackoverflow

Fix the issue that prefetcher will cause stack overflow is the input urls list is huge because of recursion function call
... ... @@ -80,7 +80,8 @@
];
}
if (self.prefetchURLs.count > self.requestedCount) {
dispatch_queue_async_safe(self.prefetcherQueue, ^{
dispatch_async(self.prefetcherQueue, ^{
// we need dispatch to avoid function recursion call. This can prevent stack overflow even for huge urls list
[self startPrefetchingAtIndex:self.requestedCount];
});
} else if (self.finishedCount == self.requestedCount) {
... ...