• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Image Batch Processing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Image Batch Processing


  • Subject: Re: Image Batch Processing
  • From: "Jere Gmail" <email@hidden>
  • Date: Fri, 21 Sep 2007 18:01:53 +0200

thanks. it worked great just adding this to the loop
NSAutoreleasePool *loopPool = [[NSAutoreleasePool alloc] init];
...loop code
[loopPool release];


On 9/21/07, Simone Tellini <email@hidden> wrote:
> Jere Gmail ha scritto:
> > HI, I've been trying to do a batch converter for images. The problem
> > is the memory is not being released properly. When the for ends the
> > memory is ok, but during the for it continues increasing. I have a
> > function with a for loop:
> >        for(count=0;count<cant;count++)
> >        {
> >                path=[datos objectAtIndex:count];
> >                save_name=[NSString stringWithFormat:
> >                                @"image_d.jpg",count+1];
> >
>
> while the for() is running you're creating several instances of
> autoreleased objects like the NSString in the line above. These objects
> are not released until the control returns to the run loop.
>
> So if you don't want to keep on allocating memory during the loop, you
> can create an NSAutoreleasePool at the start and release it at the end.
> See
> http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Concepts/AutoreleasePools.html#//apple_ref/doc/uid/20000047
>
> --
> Simone Tellini
> http://tellini.info
>
>


--
http://zon7blog.blogspot.com/
And again we fall.
_______________________________________________

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

References: 
 >Image Batch Processing (From: "Jere Gmail" <email@hidden>)
 >Re: Image Batch Processing (From: Simone Tellini <email@hidden>)

  • Prev by Date: Re: Question about scope of "convenience objects"
  • Next by Date: really weird move file problem
  • Previous by thread: Re: Image Batch Processing
  • Next by thread: really weird move file problem
  • Index(es):
    • Date
    • Thread