As discussed in the NSURLSession docs:
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, your app leaks memory until it exits.
You must call invalidateSessionCancelingTasks: in order to properly release the session manager, since NSURLSession maintains a strong reference to its delegate.
Most helpful comment
As discussed in the NSURLSession docs:
You must call
invalidateSessionCancelingTasks:in order to properly release the session manager, since NSURLSession maintains a strong reference to its delegate.