davidstump / SwiftPhoenixClient

Connect your Phoenix and iOS applications through WebSockets!
MIT License
506 stars 146 forks source link

Fix retain cycles in `URLSessionTransport` #231

Closed ejensen closed 1 year ago

ejensen commented 1 year ago

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.

dsrees commented 1 year ago

Nice, thanks!