From 771c068ad67a2ecde7f0da2bf727e0326d156c54 Mon Sep 17 00:00:00 2001 From: Kevin Date: Tue, 13 Nov 2018 08:20:20 -0800 Subject: [PATCH] Correct block self references to strongSelf (#1231) --- Source/ASNetworkImageNode.mm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/ASNetworkImageNode.mm b/Source/ASNetworkImageNode.mm index b7f4ed8eac..f1ec760287 100644 --- a/Source/ASNetworkImageNode.mm +++ b/Source/ASNetworkImageNode.mm @@ -729,17 +729,17 @@ static std::atomic_bool _useMainThreadDelegateCallbacks(true); void (^calloutBlock)(ASNetworkImageNode *inst); if (newImage) { - if (self->_delegateFlags.delegateDidLoadImageWithInfo) { + if (strongSelf->_delegateFlags.delegateDidLoadImageWithInfo) { calloutBlock = ^(ASNetworkImageNode *strongSelf) { let info = [[ASNetworkImageLoadInfo alloc] initWithURL:URL sourceType:imageSource downloadIdentifier:downloadIdentifier userInfo:userInfo]; [delegate imageNode:strongSelf didLoadImage:newImage info:info]; }; - } else if (self->_delegateFlags.delegateDidLoadImage) { + } else if (strongSelf->_delegateFlags.delegateDidLoadImage) { calloutBlock = ^(ASNetworkImageNode *strongSelf) { [delegate imageNode:strongSelf didLoadImage:newImage]; }; } - } else if (error && self->_delegateFlags.delegateDidFailWithError) { + } else if (error && strongSelf->_delegateFlags.delegateDidFailWithError) { calloutBlock = ^(ASNetworkImageNode *strongSelf) { [delegate imageNode:strongSelf didFailWithError:error]; }; @@ -753,7 +753,7 @@ static std::atomic_bool _useMainThreadDelegateCallbacks(true); } }); } else { - calloutBlock(self); + calloutBlock(strongSelf); } } });