Skip to content

Commit

Permalink
Don't set download results if no longer in preload range. (#606)
Browse files Browse the repository at this point in the history
Good catch by @djblake, if you scroll fast enough, you leave images
set on the image node because didExitPreloadRange (which would have
cleared it) was already called.
  • Loading branch information
garrettmoon authored and appleguy committed Oct 10, 2017
1 parent 78a5e43 commit 1d2bc7f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Source/ASNetworkImageNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,12 @@ - (void)_lazilyLoadImageIfNecessary

//Getting a result back for a different download identifier, download must not have been successfully canceled
if (ASObjectIsEqual(strongSelf->_downloadIdentifier, downloadIdentifier) == NO && downloadIdentifier != nil) {
return;
return;
}

//No longer in preload range, no point in setting the results (they won't be cleared in exit preload range)
if (ASInterfaceStateIncludesPreload(self->_interfaceState) == NO) {
return;
}

if (imageContainer != nil) {
Expand Down

0 comments on commit 1d2bc7f

Please sign in to comment.