Re: Memory Leaks and ARC
Re: Memory Leaks and ARC
- Subject: Re: Memory Leaks and ARC
- From: Keary Suska <email@hidden>
- Date: Tue, 22 Apr 2014 16:47:49 -0600
On Apr 22, 2014, at 4:18 PM, Dave wrote:
> This is the main loop of the mainstay of the allocations, it runs this loop around 650 times loading images of varying sizes:
>
> myCount = [myURLArray count];
> LogIfDave(@"myURLArray: %@ Count: %i",myURLArray,myCount);
> for (myIndex = 0;myIndex < myCount;myIndex++)
> {
> myFileURLString = [myURLArray objectAtIndex:myIndex];
>
> myImage = [self commandDownloadImageWithFileURLString:myFileURLString];
> if (myImage == nil)
> {
> LogIfDave(@"Download Failed: %i Count: %i",myIndex,myCount);
> continue;
> }
>
> LogIfDave(@"Download Image: %i Count: %i",myIndex,myCount);
> }
>
> I assumed that ARC would release myImage on each interation of the loop, however, this seems not to be the case, since, I see a massive release when the test conpletes and the Thread terminates.
>
> Is this correct behaviour?
I understand that it is (or typically is). To get that behavior wrap the loop contents in an @autoreleasepool{}.
HTH,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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