RE: NSImage leaking memory or just me
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