• 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: cString deprecated!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cString deprecated!


  • Subject: Re: cString deprecated!
  • From: Rosyna <email@hidden>
  • Date: Fri, 6 Sep 2002 11:26:34 -0700

I've seen too many code snippets and programs with too many bugs related to releasing a NULL value with CFRelease. This *includes* code snippets on ADC in the past and from apple employees on mailing lists. All because they assume that CFRelease will never be reached if the value is NULL, not realizing they snipped the if statement during a code rewrite or fix.

Ack, at 9/6/02, Ali Ozer said:

Well, it turns out that is not necessary at all here, just like it is not necessary at all in many cases, because the code sequence is already making the assumption cfstring is not NULL. That is, if cfstring is NULL at the time CFRelease is done, the program is already in bad shape, as there was some error in the string creation. If anything, this code sequence should do if (cfstring) check after the creation, as a validation of program logic:

--


Sincerely,
Rosyna Keller
Technical Support/Holy Knight/Always needs a hug

Unsanity: Unsane Tools for Insanely Great People
---

Please include any previous correspondence in replies, it helps me remember what we were talking about. Thanks.
_______________________________________________
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.
References: 
 >Re: cString deprecated! (From: Ali Ozer <email@hidden>)

  • Prev by Date: Re: Get parent process (Carbon question)
  • Next by Date: Re: problems filling the NSMatrix with NSImageCells in a NSMutableArray
  • Previous by thread: Re: cString deprecated!
  • Next by thread: Re: cString deprecated!
  • Index(es):
    • Date
    • Thread