mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
If Photos framework image is delivered on main queue, dispatch async to background queue
This commit is contained in:
@@ -540,7 +540,13 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent
|
||||
contentMode:request.contentMode
|
||||
options:options
|
||||
resultHandler:^(UIImage *image, NSDictionary *info) {
|
||||
completionBlock(image, info[PHImageErrorKey]);
|
||||
if (NSThread.isMainThread) {
|
||||
dispatch_async(dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0), ^{
|
||||
completionBlock(image, info[PHImageErrorKey]);
|
||||
});
|
||||
} else {
|
||||
completionBlock(image, info[PHImageErrorKey]);
|
||||
}
|
||||
}];
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user