2
0
Эх сурвалжийг харах

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

Mattt Thompson 11 жил өмнө
parent
commit
7121cc86a7

+ 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
             }
         }