Fixed memory leak in NSURLSession handling by sound-eng · Pull Request #2794 · AFNetworking/AFNetworking · GitHub
Skip to content
This repository was archived by the owner on Jan 17, 2023. It is now read-only.

Fixed memory leak in NSURLSession handling#2794

Closed
sound-eng wants to merge 2 commits into
AFNetworking:masterfrom
sound-eng:master
Closed

Fixed memory leak in NSURLSession handling#2794
sound-eng wants to merge 2 commits into
AFNetworking:masterfrom
sound-eng:master

Conversation

@sound-eng

Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+ (NSURLSession * nonnull)sessionWithConfiguration:(NSURLSessionConfiguration * nonnull)configuration

This method actually requires an argument according to iOS 9 sdk nullability

@phoney

phoney commented Sep 25, 2015

Copy link
Copy Markdown

This is a real bug that should be fixed. Apple's docs say

"The session object keeps a strong reference to the delegate until your app explicitly invalidates the session. If you do not invalidate the session, your app leaks memory."

alistra's comments are correct but the fix is trivial. Just add the default configuration when creating the session. I believe that @kcharwood wrote this code so maybe you want to fix this if @olegnaumenko isn't responding.

@kcharwood

Copy link
Copy Markdown
Contributor

I'll take a look at this soon. Thanks @phoney

@kcharwood kcharwood added this to the 2.6.2 milestone Oct 21, 2015
kcharwood added a commit that referenced this pull request Oct 21, 2015
@kcharwood

Copy link
Copy Markdown
Contributor

Rebased with some additional changes in 09f6cc1

kcharwood added a commit that referenced this pull request Oct 21, 2015
@kcharwood

Copy link
Copy Markdown
Contributor

@kcharwood kcharwood closed this Oct 21, 2015
@kcharwood kcharwood changed the title fix memory leak in NSURLSession handling Fixed memory leak in NSURLSession handling Nov 3, 2015
@kcharwood kcharwood added the fixed label Nov 3, 2015
sergiou87 pushed a commit to plexinc/afnetworking that referenced this pull request Dec 12, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants