Browse Source

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

Mattt Thompson 11 years ago
parent
commit
7121cc86a7
1 changed files with 2 additions and 0 deletions
  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!) {
         func URLSession(session: NSURLSession!, task: NSURLSessionTask!, didCompleteWithError error: NSError!) {
             if let delegate = self[task] {
             if let delegate = self[task] {
                 delegate.URLSession(session, task: task, didCompleteWithError: error)
                 delegate.URLSession(session, task: task, didCompleteWithError: error)
+
+                self[task] = nil
             }
             }
         }
         }