This PR breaks two retain cycle. One caused by strongly capturing self within the URLSessionTransport’s task closure. The second was caused by not invalidating the URLSession after disconnection. The URLSession must be invalidated since it will otherwise keep a strong reference to its delegate (URLSessionTransport) indefinitely.
This PR breaks two retain cycle. One caused by strongly capturing
self
within theURLSessionTransport
’s task closure. The second was caused by not invalidating theURLSession
after disconnection. The URLSession must be invalidated since it will otherwise keep a strong reference to its delegate (URLSessionTransport
) indefinitely.