mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-09-10 14:35:42 +00:00
Have ASMultiplexImageNode store its image request operation weakly
This commit is contained in:
parent
f0b7e150cd
commit
fffc76a353
@ -66,7 +66,7 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent
|
|||||||
id _loadedImageIdentifier;
|
id _loadedImageIdentifier;
|
||||||
id _loadingImageIdentifier;
|
id _loadingImageIdentifier;
|
||||||
id _displayedImageIdentifier;
|
id _displayedImageIdentifier;
|
||||||
NSOperation *_phImageRequestOperation;
|
__weak NSOperation *_phImageRequestOperation;
|
||||||
|
|
||||||
// Networking.
|
// Networking.
|
||||||
id _downloadIdentifier;
|
id _downloadIdentifier;
|
||||||
@ -547,7 +547,7 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent
|
|||||||
[_phImageRequestOperation cancel];
|
[_phImageRequestOperation cancel];
|
||||||
|
|
||||||
__weak __typeof(self)weakSelf = self;
|
__weak __typeof(self)weakSelf = self;
|
||||||
_phImageRequestOperation = [NSBlockOperation blockOperationWithBlock:^{
|
NSOperation *newImageRequestOp = [NSBlockOperation blockOperationWithBlock:^{
|
||||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||||
if (strongSelf == nil) { return; }
|
if (strongSelf == nil) { return; }
|
||||||
|
|
||||||
@ -590,7 +590,8 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent
|
|||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
}];
|
}];
|
||||||
[phImageRequestQueue addOperation:_phImageRequestOperation];
|
_phImageRequestOperation = newImageRequestOp;
|
||||||
|
[phImageRequestQueue addOperation:newImageRequestOp];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)_fetchImageWithIdentifierFromCache:(id)imageIdentifier URL:(NSURL *)imageURL completion:(void (^)(UIImage *image))completionBlock
|
- (void)_fetchImageWithIdentifierFromCache:(id)imageIdentifier URL:(NSURL *)imageURL completion:(void (^)(UIImage *image))completionBlock
|
||||||
|
Loading…
x
Reference in New Issue
Block a user