Re: nested autorelease pools?
Re: nested autorelease pools?
- Subject: Re: nested autorelease pools?
- From: j o a r <email@hidden>
- Date: Tue, 1 Nov 2005 21:34:53 +0100
On 1 nov 2005, at 21.16, Brian O'Brien wrote:
Does this look valid to you?
-(id) init
{
self = [super init];
mypool = [[NSAutoreleasePool alloc] init];
return self;
}
-(void) dealloc
{
[mypool release];
[super dealloc];
}
NSAutoreleasePool is a very special class, with special requirements.
The above is incorrect, because (as snipped from the documentation of
this class):
"An autorelease pool should always be released in the same context
(invocation of a method or function, or body of a loop) that it was
created."
An autorelease pool lives in "execution scope", and not "object scope".
j o a r
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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