Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory leak for URLSession #21

Open
Shvier opened this issue Mar 12, 2020 · 0 comments
Open

memory leak for URLSession #21

Shvier opened this issue Mar 12, 2020 · 0 comments

Comments

@Shvier
Copy link

Shvier commented Mar 12, 2020

  • Platform: iOS x86 Simulator
  • OS Version: 13.3
  • Issue Detail
    class HTTP in AcceptSDK does not deallocate after getTokenWithRequest completed

Instruments_2020-03-12 16-25-04@2x

  • 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 to HTTP.
    session.finishTasksAndInvalidate()
    Add the above code after semaphore.wait

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant