• 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: NSImage leaking memory or just me
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: NSImage leaking memory or just me


  • Subject: RE: NSImage leaking memory or just me
  • From: "Jordan Evans" <email@hidden>
  • Date: Thu, 28 Sep 2006 11:53:33 -0700

I rewrote the code.  This should work:

- (void)method
{
	NSAutoreleasePool* pool;
	int i, count = 4;

	for ( i = 0;  i < count; i++)
	{
		NSImage* img = [[NSImage alloc] initWithContentsOfFile:@"star.jpg"];

		if (!img)
		{
			continue;
		}
		else
		{
			pool = [[NSAutoreleasePool alloc] init];

			// I'm assuming you need to add thing's to your pool here and your
image is neccessary to be around at that time.

			[pool release];
			pool = nil;

			[img release];
			img = nil;
		}
	}
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: NSimage leaking memory or probably just me
  • Next by Date: Re: Re: NSimage leaking memory or probably just me
  • Previous by thread: Re: Creating reflected style Images from NSImage
  • Next by thread: Removed view still getting events
  • Index(es):
    • Date
    • Thread