• 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: alloc, init and autorelease/release
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: alloc, init and autorelease/release


  • Subject: Re: alloc, init and autorelease/release
  • From: Clark Cox <email@hidden>
  • Date: Tue, 25 Oct 2005 07:32:29 -0400

On 10/24/05, Felix Schwarz <email@hidden> wrote:
> Thanks for the answers!
>
> FYI, what I'm trying to do here is to return a nil pointer in case
> something in the init-method failed (i.e. allocation of additional
> buffer memory failed or not all paramters were supplied).
>
> Regarding [self autorelease], I just want to be sure there isn't even
> the slightiest chance that any storage that might still be required,
> is free()d up while a routine of the object whose storage is being
> free()d does still execute anything.

You needn't worry about that. While inside your init method, nobody
else has a pointer to your object to even *try* to do anything.
Additionally, even if someone else did have a pointer to it, it would
have been their responsibility to retain it.

--
Clark S. Cox III
email@hidden
http://clarkcox3.livejournal.com/
http://homepage.mac.com/clarkcox3/
 _______________________________________________
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

References: 
 >alloc, init and autorelease/release (From: Felix Schwarz <email@hidden>)
 >Re: alloc, init and autorelease/release (From: j o a r <email@hidden>)
 >Re: alloc, init and autorelease/release (From: jkp <email@hidden>)
 >Re: alloc, init and autorelease/release (From: Felix Schwarz <email@hidden>)

  • Prev by Date: MallocDebug: The app's own code is in an "unknown library"
  • Next by Date: Problem while Porting from tiger to Panther
  • Previous by thread: Re: alloc, init and autorelease/release
  • Next by thread: How to set width of "tab" (\t) in NSTextView?
  • Index(es):
    • Date
    • Thread