You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to Apple documentation, URLSession's delegate object is strongly referenced.
Important
The session object keeps a strong reference to the delegate until your app exits or explicitly invalidates the session. If you do not invalidate the session by calling the invalidateAndCancel() or finishTasksAndInvalidate() method, your app leaks memory until it exits.
Since neither of the above methods are called within URLSessionHTTPClient, a memory leak occurs.
In fact, you can confirm the memory leak by launching the ElizaSwiftPackageApp included in this repository and following the steps below.
Hi,
There is a circular reference between
URLSessionHTTPClient
andURLSession
it retains.connect-swift/Libraries/Connect/Public/Implementation/Clients/URLSessionHTTPClient.swift
Lines 36 to 43 in 20c7871
According to Apple documentation,
URLSession
's delegate object is strongly referenced.Since neither of the above methods are called within
URLSessionHTTPClient
, a memory leak occurs.In fact, you can confirm the memory leak by launching the ElizaSwiftPackageApp included in this repository and following the steps below.
You can see that only one
ProtocolClient
remains in memory, whereas theURLSessionHTTPClient
remains as many as the steps 1-2 above were repeated.The text was updated successfully, but these errors were encountered: