File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 26
26
BOOL SDWebImageDownloaderOperationGetCompleted (id <SDWebImageDownloaderOperation> operation) {
27
27
NSCParameterAssert (operation);
28
28
NSNumber *value = objc_getAssociatedObject (operation, SDWebImageDownloaderOperationKey);
29
- if (value) {
29
+ if (value != nil ) {
30
30
return value.boolValue ;
31
31
} else {
32
32
return NO ;
Original file line number Diff line number Diff line change @@ -116,9 +116,14 @@ - (NSTimeInterval)duration {
116
116
// Supports Pro display 120Hz
117
117
CGDirectDisplayID display = CVDisplayLinkGetCurrentCGDisplay (_displayLink);
118
118
CGDisplayModeRef mode = CGDisplayCopyDisplayMode (display);
119
- double refreshRate = CGDisplayModeGetRefreshRate (mode);
120
- if (refreshRate > 0 ) {
121
- duration = 1.0 / refreshRate;
119
+ if (mode) {
120
+ double refreshRate = CGDisplayModeGetRefreshRate (mode);
121
+ if (refreshRate > 0 ) {
122
+ duration = 1.0 / refreshRate;
123
+ } else {
124
+ duration = kSDDisplayLinkInterval ;
125
+ }
126
+ CGDisplayModeRelease (mode);
122
127
} else {
123
128
duration = kSDDisplayLinkInterval ;
124
129
}
You can’t perform that action at this time.
0 commit comments