Skip to content

Commit

Permalink
Merge pull request Tencent#468 from passerbyloo/master
Browse files Browse the repository at this point in the history
fix: request image for asset memory leaks
  • Loading branch information
kayo5994 authored Dec 27, 2018
2 parents bcd6789 + d3b456b commit 90b9c98
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions QMUIKit/QMUIComponents/AssetLibrary/QMUIAsset.m
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ - (NSInteger)requestOriginImageWithCompletion:(void (^)(UIImage *result, NSDicti
PHImageRequestOptions *imageRequestOptions = [[PHImageRequestOptions alloc] init];
imageRequestOptions.networkAccessAllowed = YES; // 允许访问网络
imageRequestOptions.progressHandler = phProgressHandler;
return [[[QMUIAssetsManager sharedInstance] phCachingImageManager] requestImageForAsset:_phAsset targetSize:PHImageManagerMaximumSize contentMode:PHImageContentModeDefault options:imageRequestOptions resultHandler:^(UIImage *result, NSDictionary *info) {
return [[[QMUIAssetsManager sharedInstance] phCachingImageManager] requestImageDataForAsset:_phAsset options:imageRequestOptions resultHandler:^(NSData * _Nullable imageData, NSString * _Nullable dataUTI, UIImageOrientation orientation, NSDictionary * _Nullable info) {
if (completion) {
completion(result, info);
completion([UIImage imageWithData:imageData], info);
}
}];
}
Expand Down

0 comments on commit 90b9c98

Please sign in to comment.