Re: Memory management question
Re: Memory management question
- Subject: Re: Memory management question
- From: Bjoern Kriews <email@hidden>
- Date: Wed, 24 Mar 2004 23:20:39 +0100
On 24.03.2004, at 20:14, Alastair Houghton wrote:
pools to clean them up as and when necessary. Alternatively, you can
immediately release any individual autoreleased object by doing
[[someObject retain] release];
(The -retain increments the reference count, removing it from the
autorelease pool, then the -release triggers the deallocation of the
object.)
I find this a little bit disturbing because I was under the impression
that a retain/release pair would leave the object in the exact same
state regarding memory management.
I was not able to find a hint in the docs about this fact,
so I think we are at (the somewhat unlikely) risk that:
id autoreleasedThingy = [SomeThing thingy];
// assuming there is a hidden retain/release inside
[ThirdPartyClass damageThingy: autoreleasedThingy];
NSLog(@"at: %@", autoreleasedThingy);
will crash ?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.