Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #6483: downloadqueue callbacks should be main thread only #6558

Merged
merged 1 commit into from
May 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions Client/Frontend/Browser/DownloadQueue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

import Foundation

private let downloadOperationQueue = OperationQueue()

protocol DownloadDelegate {
func download(_ download: Download, didCompleteWithError error: Error?)
func download(_ download: Download, didDownloadBytes bytesDownloaded: Int64)
Expand Down Expand Up @@ -86,7 +84,7 @@ class HTTPDownload: Download {

self.totalBytesExpected = preflightResponse.expectedContentLength > 0 ? preflightResponse.expectedContentLength : nil

self.session = URLSession(configuration: .default, delegate: self, delegateQueue: downloadOperationQueue)
self.session = URLSession(configuration: .default, delegate: self, delegateQueue: .main)
self.task = session?.downloadTask(with: request)
}

Expand Down