Skip to content

Commit 95def40

Browse files
memory issue remove Data
Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
1 parent 9f3e0c8 commit 95def40

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Sources/NextcloudKit/NextcloudKit+Download.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public extension NextcloudKit {
1414
requestHandler: @escaping (_ request: DownloadRequest) -> Void = { _ in },
1515
taskHandler: @escaping (_ task: URLSessionTask) -> Void = { _ in },
1616
progressHandler: @escaping (_ progress: Progress) -> Void = { _ in },
17-
completionHandler: @escaping (_ account: String, _ etag: String?, _ date: Date?, _ lenght: Int64, _ responseData: AFDownloadResponse<Data>?, _ afError: AFError?, _ nKError: NKError) -> Void) {
17+
completionHandler: @escaping (_ account: String, _ etag: String?, _ date: Date?, _ lenght: Int64, _ afError: AFError?, _ nKError: NKError) -> Void) {
1818
var convertible: URLConvertible?
1919
if serverUrlFileName is URL {
2020
convertible = serverUrlFileName as? URLConvertible
@@ -24,7 +24,7 @@ public extension NextcloudKit {
2424
guard let url = convertible,
2525
let nkSession = nkCommonInstance.nksessions.session(forAccount: account),
2626
let headers = nkCommonInstance.getStandardHeaders(account: account, options: options) else {
27-
return options.queue.async { completionHandler(account, nil, nil, 0, nil, nil, .urlError) }
27+
return options.queue.async { completionHandler(account, nil, nil, 0, nil, .urlError) }
2828
}
2929
var destination: Alamofire.DownloadRequest.Destination?
3030
let fileNamePathLocalDestinationURL = NSURL.fileURL(withPath: fileNameLocalPath)
@@ -42,7 +42,7 @@ public extension NextcloudKit {
4242
switch response.result {
4343
case .failure(let error):
4444
let resultError = NKError(error: error, afResponse: response, responseData: nil)
45-
options.queue.async { completionHandler(account, nil, nil, 0, response, error, resultError) }
45+
options.queue.async { completionHandler(account, nil, nil, 0, error, resultError) }
4646
case .success:
4747
var date: Date?
4848
var etag: String?
@@ -63,7 +63,7 @@ public extension NextcloudKit {
6363
date = dateRaw.parsedDate(using: "yyyy-MM-dd HH:mm:ss")
6464
}
6565

66-
options.queue.async { completionHandler(account, etag, date, length, response, nil, .success) }
66+
options.queue.async { completionHandler(account, etag, date, length, nil, .success) }
6767
}
6868
}
6969

0 commit comments

Comments
 (0)