• 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: Non-NSObject object and garbage collection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Non-NSObject object and garbage collection


  • Subject: Re: Non-NSObject object and garbage collection
  • From: Quincey Morris <email@hidden>
  • Date: Tue, 12 Aug 2008 23:30:31 -0700

On Aug 12, 2008, at 22:52, Ken Ferry wrote:

In general, you don't need to CFRetain an object to keep it alive
while it's on the stack.  The fact that it's on the stack is enough.
If this wasn't true, there'd be a race, since the collector might
destroy the object before you retained it.

Unless I misunderstand your point, its being on the stack will only keep it alive if CFMakeCollectable has already been called on it. In a case where you're given a CF-type object that you don't own, I don't think you can assume that. If it has not been made collectable, it's being kept alive by a non-zero retain count, or by having being autoreleased, either of which will keep it alive long enough for you to retain it.


_______________________________________________

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: Non-NSObject object and garbage collection
      • From: "Ken Ferry" <email@hidden>
References: 
 >Non-NSObject object and garbage collection (From: "Oleg Krupnov" <email@hidden>)
 >Re: Non-NSObject object and garbage collection (From: Antonio Nunes <email@hidden>)
 >Re: Non-NSObject object and garbage collection (From: Antonio Nunes <email@hidden>)
 >Re: Non-NSObject object and garbage collection (From: "Oleg Krupnov" <email@hidden>)
 >Re: Non-NSObject object and garbage collection (From: "Ken Ferry" <email@hidden>)
 >Re: Non-NSObject object and garbage collection (From: "Oleg Krupnov" <email@hidden>)
 >Re: Non-NSObject object and garbage collection (From: Quincey Morris <email@hidden>)
 >Re: Non-NSObject object and garbage collection (From: "Ken Ferry" <email@hidden>)

  • Prev by Date: Re: DICOM images in Cocoa
  • Next by Date: Re: Accessing memory of another application?
  • Previous by thread: Re: Non-NSObject object and garbage collection
  • Next by thread: Re: Non-NSObject object and garbage collection
  • Index(es):
    • Date
    • Thread