From f225f952995a04089740dbb247235edc5eb0c222 Mon Sep 17 00:00:00 2001 From: Garvan Keeley Date: Wed, 6 May 2020 17:50:26 -0400 Subject: [PATCH] Fix #6483: downloadqueue callbacks should be main thread only (#6558) --- Client/Frontend/Browser/DownloadQueue.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Client/Frontend/Browser/DownloadQueue.swift b/Client/Frontend/Browser/DownloadQueue.swift index 941d2b373790..27f78507cd77 100644 --- a/Client/Frontend/Browser/DownloadQueue.swift +++ b/Client/Frontend/Browser/DownloadQueue.swift @@ -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) @@ -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) }