Afnetworking: NSURLSessionConfiguration cause memory leak,should [manager.session finishTasksAndInvalidate] or [self.manager.session invalidateAndCancel] in AFN ?

Created on 26 May 2016  路  1Comment  路  Source: AFNetworking/AFNetworking

Most helpful comment

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.

>All comments

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.

Was this page helpful?
0 / 5 - 0 ratings