Unverified Commit d5ae7b77 authored by 谭真's avatar 谭真 Committed by GitHub

Merge pull request #1449 from macMaJi/master

fix 内存泄漏
parents ba97a4a2 6b07cc52
......@@ -467,10 +467,10 @@ static dispatch_once_t onceToken;
[option setProgressHandler:progressHandler];
}
option.resizeMode = PHImageRequestOptionsResizeModeFast;
return [[PHImageManager defaultManager] requestImageForAsset:asset targetSize:PHImageManagerMaximumSize contentMode:PHImageContentModeAspectFit options:option resultHandler:^(UIImage *result, NSDictionary *info) {
return [[PHImageManager defaultManager] requestImageDataForAsset:asset options:option resultHandler:^(NSData * _Nullable imageData, NSString * _Nullable dataUTI, UIImageOrientation orientation, NSDictionary * _Nullable info) {
BOOL cancelled = [[info objectForKey:PHImageCancelledKey] boolValue];
if (!cancelled && result) {
result = [self fixOrientation:result];
if (!cancelled && imageData) {
UIImage *result = [self fixOrientation:[UIImage imageWithData:imageData]];
BOOL isDegraded = [[info objectForKey:PHImageResultIsDegradedKey] boolValue];
if (completion) completion(result,info,isDegraded);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment