Pārlūkot izejas kodu

[Issue #70] Removing subdelegate after didCompleteWithError delegate method, to allow for deallocation with Request

Mattt Thompson 11 gadi atpakaļ
vecāks
revīzija
7121cc86a7
1 mainītis faili ar 2 papildinājumiem un 0 dzēšanām
  1. 2 0
      Source/Alamofire.swift

+ 2 - 0
Source/Alamofire.swift

@@ -335,6 +335,8 @@ public class Manager {
         func URLSession(session: NSURLSession!, task: NSURLSessionTask!, didCompleteWithError error: NSError!) {
             if let delegate = self[task] {
                 delegate.URLSession(session, task: task, didCompleteWithError: error)
+
+                self[task] = nil
             }
         }