accept-sample-ios
accept-sample-ios copied to clipboard
memory leak for URLSession
-
Platform: iOS x86 Simulator
-
OS Version: 13.3
-
Issue Detail class
HTTP
in AcceptSDK does not deallocate aftergetTokenWithRequest
completed-
Steps to Reproduce call
getTokenWithRequest
-
Reason In this line, class
HTTP
has been set as URLSession's delegate, and URLSessionDelegate is a strong reference property, not weak reference -
Solution After
task
has finished, making URLSession invalidate will remove the reference toHTTP
.session.finishTasksAndInvalidate()
Add the above code after semaphore.wait
-