• 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: Immediate memory release
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Immediate memory release


  • Subject: Re: Immediate memory release
  • From: Graham Cox <email@hidden>
  • Date: Wed, 30 Apr 2008 22:18:13 +1000

-(IBAction) Generate:(id) sender
{
	for (i = 0; i < count; i++)
	{
	    NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];

NSImage* tempSource = [[NSImage alloc] initWithContentsOfFile:sPath[i]];
// some code
[tempSource release];

[pool release];
}
}




hth, G.


On 30 Apr 2008, at 10:09 pm, Yannick De Koninck wrote:
I deleted everything that was between NSImage* tempSource = [[NSImage alloc] initWithContentsOfFile:sPath[i]; and [tempSource release]; so basically this is the code (sPath is a NSString array containing path names):
-(IBAction)Generate:(id)sender
{



for (i = 0; i < count; i++)
{
NSImage* tempSource = [[NSImage alloc] initWithContentsOfFile:sPath[i]];
[tempSource release];
}


}

And still the same problem occurs. So the problem is that the memory is not immediately released. You think this can be solved by using an autoreleasepool? I'm pretty new to cocoa programming and i never used autoreleasepools before.
Thank you very much, Yannick

_______________________________________________

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


  • Follow-Ups:
    • Re: Immediate memory release
      • From: email@hidden
    • Re: Immediate memory release
      • From: Roland King <email@hidden>
References: 
 >Immediate memory release (From: Yannick De Koninck <email@hidden>)
 >Re: Immediate memory release (From: Graham Cox <email@hidden>)
 >Re: Immediate memory release (From: "Paul Bailey" <email@hidden>)
 >Re: Immediate memory release (From: Yannick De Koninck <email@hidden>)

  • Prev by Date: Re: Is there any compression library for Cocoa?
  • Next by Date: wanna extend openGLVideo functionality by adding movie navigation slider
  • Previous by thread: Re: Immediate memory release
  • Next by thread: Re: Immediate memory release
  • Index(es):
    • Date
    • Thread