Re: Debugging memory leak in NSURLSession with ARC
Re: Debugging memory leak in NSURLSession with ARC
- Subject: Re: Debugging memory leak in NSURLSession with ARC
- From: Graham Cox <email@hidden>
- Date: Fri, 02 Jan 2015 13:26:41 +1100
> On 2 Jan 2015, at 12:48 pm, Quincey Morris <email@hidden> wrote:
>
> **** That usually means the block and the ‘self’ it captured mutually refer to each other. I’m betting this is what’s wrong in your case.
>
>
Quincey, thanks for your lengthy and well-thought-out reply (as usual) :)
I think you've hit the nail straight on the head (as usual), with the block/self problem. It's one I knew about before, but had forgotten again in my excitement at getting the code running. The question is what to do about it.
My handler block refers to 'self' quite extensively - it calls other methods of self and also refers to properties such as self.delegate. I'm not quite sure how I can rework it not to refer to self. Maybe I just need to not use the completion block approach and use a delegate callback instead. I need to go away and think about this... thanks for the slap about the head.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden