SDWebImageDownloaderOperation: call endBackgroundTask after operation is finished so that beginBackgroundTaskWithExpirationHandler and endBackgroundTask are balanced
This commit is contained in:
parent
938c2e0f3f
commit
efb0b359bf
|
|
@ -108,6 +108,13 @@
|
|||
self.completedBlock(nil, nil, [NSError errorWithDomain:NSURLErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey : @"Connection can't be initialized"}], YES);
|
||||
}
|
||||
}
|
||||
|
||||
#if TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_0
|
||||
if (self.backgroundTaskId != UIBackgroundTaskInvalid) {
|
||||
[[UIApplication sharedApplication] endBackgroundTask:self.backgroundTaskId];
|
||||
self.backgroundTaskId = UIBackgroundTaskInvalid;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)cancel {
|
||||
|
|
|
|||
Loading…
Reference in New Issue