Fix the test case again on below iOS 15
This commit is contained in:
parent
f8d353b50c
commit
7ddf3214e6
|
@ -23,8 +23,8 @@ static NSString * kSDCGImageSourceRasterizationDPI = @"kCGImageSourceRasterizati
|
||||||
// Specify File Size for lossy format encoding, like JPEG
|
// Specify File Size for lossy format encoding, like JPEG
|
||||||
static NSString * kSDCGImageDestinationRequestedFileSize = @"kCGImageDestinationRequestedFileSize";
|
static NSString * kSDCGImageDestinationRequestedFileSize = @"kCGImageDestinationRequestedFileSize";
|
||||||
|
|
||||||
// Only assert on Debug mode and Simulator
|
// Only assert on Debug mode
|
||||||
#define SD_CHECK_CGIMAGE_RETAIN_SOURCE DEBUG && TARGET_OS_SIMULATOR && \
|
#define SD_CHECK_CGIMAGE_RETAIN_SOURCE DEBUG && \
|
||||||
((__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_15_0)) || \
|
((__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_15_0)) || \
|
||||||
((__TV_OS_VERSION_MAX_ALLOWED >= __TVOS_15_0))
|
((__TV_OS_VERSION_MAX_ALLOWED >= __TVOS_15_0))
|
||||||
|
|
||||||
|
@ -300,10 +300,12 @@ static CGImageRef __nullable SDCGImageCreateCopy(CGImageRef cg_nullable image) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if SD_CHECK_CGIMAGE_RETAIN_SOURCE
|
#if SD_CHECK_CGIMAGE_RETAIN_SOURCE
|
||||||
// Assert here to check CGImageRef should not retain the CGImageSourceRef and has possible thread-safe issue (this is behavior on iOS 15+)
|
if (@available(iOS 15, tvOS 15, *)) {
|
||||||
// If assert hit, fire issue to https://github.com/SDWebImage/SDWebImage/issues and we update the condition for this behavior check
|
// Assert here to check CGImageRef should not retain the CGImageSourceRef and has possible thread-safe issue (this is behavior on iOS 15+)
|
||||||
extern CGImageSourceRef CGImageGetImageSource(CGImageRef);
|
// If assert hit, fire issue to https://github.com/SDWebImage/SDWebImage/issues and we update the condition for this behavior check
|
||||||
NSCAssert(!CGImageGetImageSource(imageRef), @"Animated Coder created CGImageRef should not retain CGImageSourceRef, which may cause thread-safe issue without lock");
|
extern CGImageSourceRef CGImageGetImageSource(CGImageRef);
|
||||||
|
NSCAssert(!CGImageGetImageSource(imageRef), @"Animated Coder created CGImageRef should not retain CGImageSourceRef, which may cause thread-safe issue without lock");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SD_UIKIT || SD_WATCH
|
#if SD_UIKIT || SD_WATCH
|
||||||
|
|
Loading…
Reference in New Issue