-
-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid premature completion of prefetcher if request fails #751
Conversation
While exceedingly unlikely, the old construct introduced potential race condition where it checked wself first, and assigned sself second. This now assigns sself first, and then checks that, which is the correct pattern, already used elsewhere in SDWebImage.
…uld finish prematurely if any requests were skipped. Also adjusted documentation in headers to make it clear that the `finishedCount` includes both successful and unsuccessful requests.
You might want to rebuild the appledoc-based class framework documentation to reflect the header documentation changes. |
Avoid premature completion of prefetcher if request fails
@rs Please review as well, especially the |
The |
Technically, in this case, it doesn't matter, because the First, to illustrate the recommended pattern, look at Transitioning to ARC Release Notes, there is a section called "Use Lifetime Qualifiers to Avoid Strong Reference Cycles", in which there is an example that says:
Note, you assign the If you do it the other way around (check to see if the Usually, when you do this |
@robertmryan thanks for the detailed explanation. You are 100% correct. |
This addresses a number of issues, namely:
finishedCount
parameter, making it clear that it includes both successful and unsuccessful requests.SDWebimageDownloader
.