Re: retain and autorelease
Re: retain and autorelease
- Subject: Re: retain and autorelease
- From: Kyle Moffett <email@hidden>
- Date: Fri, 14 Nov 2003 17:27:06 -0500
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Nov 14, 2003, at 16:26, Ben Dougall wrote:
that's something i've never been sure on - the lifetime of an
unretained object like that. you say it'll probably hang round until
the end of the current method - what about if there's a method call
inbetween the above non retained convenience creation and the end of
the current method? even a simple presumably short/quick method call
like adding an object to an array for exmaple? that takes the thread
elsewhere, out of the current method. would it still be ok not to
retain do you think?
Assuming the method you call is a well-behaved method, it should not
release any more than it has retained, so your object will not
disappear out from under you. An unretained object like that is in the
autorelease pool of a method up the call stack, and you can't
(without setjmp/longjmp) get back up there without first passing back
into your method. An object like that is fine.
Cheers,
Kyle Moffett
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (Darwin)
iD8DBQE/tVa6ag7LSGnFq10RAifAAJ9H3CxLdmAuz60TY4VXace6uGNvkQCfVe3n
WcADvAXCdFHaRG+5Z+IYKPU=
=JZ0Y
-----END PGP SIGNATURE-----
_______________________________________________
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.