Skip to content

Commit

Permalink
Fix mozilla-mobile#6483: downloadqueue callbacks should be main threa…
Browse files Browse the repository at this point in the history
…d only
  • Loading branch information
garvankeeley committed May 6, 2020
1 parent d398587 commit 5724cc2
Showing 1 changed file with 1 addition and 3 deletions.
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

0 comments on commit 5724cc2

Please sign in to comment.