Skip to content

Commit

Permalink
Don't set download results if no longer in preload range. (TextureGro…
Browse files Browse the repository at this point in the history
…up#606)

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 bernieperez committed Apr 25, 2018
1 parent 75adacf commit 6bb278c
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 6bb278c

Please sign in to comment.