mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-25 04:47:55 +00:00
Use finishTasksAndInvalidate instead of invalidateAndCancel
-cleanup is only called when the task has finished, so it's safe to do this.
This silences a spurious warning logged by NSURLSession (or somewhere else internal):
Task <BB2AE4EF-8E93-44D7-9AB3-6EE9A9E3ACF8>.<1> load failed with error Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey=https://example.com/appcast.xml, NSErrorFailingURLKey=https://example.com/appcast.xml, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDownloadTask <BB2AE4EF-8E93-44D7-9AB3-6EE9A9E3ACF8>.<1>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <BB2AE4EF-8E93-44D7-9AB3-6EE9A9E3ACF8>.<1>, NSLocalizedDescription=cancelled} [-999]
This commit is contained in:
1 parent
2e1596c673
commit
01bc8628da
1 file changed
+1
-1
@@ -115,7 +115,7 @@ static NSString *SUDownloadingReason = @"Downloading update related file";
|
||||
{
|
||||
[self enableAutomaticTermination];
|
||||
[self.download cancel];
|
||||
[self.downloadSession invalidateAndCancel];
|
||||
[self.downloadSession finishTasksAndInvalidate];
|
||||
self.download = nil;
|
||||
self.downloadSession = nil;
|
||||
self.delegate = nil;
|
||||
|
||||
Reference in new issue
Block a user