From bcba6e6f521f783fc6f8181c4b23f95715a472f8 Mon Sep 17 00:00:00 2001 From: Garrett Moon Date: Sun, 8 Oct 2017 10:53:01 -0700 Subject: [PATCH] Don't set download results if no longer in preload range. 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. --- Source/ASNetworkImageNode.mm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/ASNetworkImageNode.mm b/Source/ASNetworkImageNode.mm index d96932276..2b22ea526 100755 --- a/Source/ASNetworkImageNode.mm +++ b/Source/ASNetworkImageNode.mm @@ -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) {