Skip to content

memory leak for URLSession #21

@Shvier

Description

@Shvier
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions