Fix case where we forget to unlock in ASNetworkImagenode (#17)

This commit is contained in:
Adlai Holler 2017-04-17 11:38:07 -07:00 committed by GitHub
parent 9f6ec95b53
commit fdb54a02d9

View File

@ -403,7 +403,7 @@ static const CGSize kMinReleaseImageOnBackgroundSize = {20.0, 20.0};
- (void)handleProgressImage:(UIImage *)progressImage progress:(CGFloat)progress downloadIdentifier:(nullable id)downloadIdentifier
{
__instanceLock__.lock();
ASDN::MutexLocker l(__instanceLock__);
// Getting a result back for a different download identifier, download must not have been successfully canceled
if (ASObjectIsEqual(_downloadIdentifier, downloadIdentifier) == NO && downloadIdentifier != nil) {
@ -412,8 +412,6 @@ static const CGSize kMinReleaseImageOnBackgroundSize = {20.0, 20.0};
[self _locked_setCurrentImageQuality:progress];
[self _locked__setImage:progressImage];
__instanceLock__.unlock();
}
- (void)_updateProgressImageBlockOnDownloaderIfNeeded