• 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: CGImageRef as a property of a cocoa object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CGImageRef as a property of a cocoa object


  • Subject: Re: CGImageRef as a property of a cocoa object
  • From: Ed Wynne <email@hidden>
  • Date: Sun, 22 Sep 2013 13:59:17 -0400

> On Sep 22, 2013, at 5:07 AM, Graham Cox <email@hidden> wrote:
>> Not if there is a specific retain/release function such as CGImageRetain, CGImageRelease. These ignore nil. You should always use these instead of a generic CFRelease because they may do additional work for all we know.

No, these functions exist for purely philosophical reasons. If CG objects are CF objects they should never be used in practice and should be deprecated.

Why? Because if CG objects are CF objects, they can be put into collections. They can get extra retains and releases in any number of places that know nothing of their originating API. That also means when the final release comes, it could be the balance to any retain, not just your special API call. It literally is not up to you in any deterministic sense, and can even change from release to release.

The standard release mechanism must be 100% sufficient. Checking for NULL is no excuse to violate the object model.

- Ed


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: CGImageRef as a property of a cocoa object
      • From: Kyle Sluder <email@hidden>
References: 
 >CGImageRef as a property of a cocoa object (From: Kevin Meaney <email@hidden>)
 >Re: CGImageRef as a property of a cocoa object (From: Roland King <email@hidden>)
 >Re: CGImageRef as a property of a cocoa object (From: Dave <email@hidden>)
 >Re: CGImageRef as a property of a cocoa object (From: Graham Cox <email@hidden>)

  • Prev by Date: wrapping a really long word in an UILabel
  • Next by Date: Grouped table view appearance in iOS 7
  • Previous by thread: Re: CGImageRef as a property of a cocoa object
  • Next by thread: Re: CGImageRef as a property of a cocoa object
  • Index(es):
    • Date
    • Thread