Re: CoreFoundation object over-retained during finalization
Re: CoreFoundation object over-retained during finalization
- Subject: Re: CoreFoundation object over-retained during finalization
- From: Quincey Morris <email@hidden>
- Date: Sat, 12 Mar 2011 12:11:16 -0800
On Mar 12, 2011, at 11:41, email@hidden wrote:
> I have examined my code carefully and just cannot get any traction on this.
> The SecKeychainRef is stashed on the stack and passed into a class method so I don't see how it could get anywhere near a finalize method.
Well, according to your earlier post the class method returns 'mySSLIdentity'. That's going to get finalized some time, isn't it? What if this object has a weak reference to (or a reference to an object that has a weak reference to) the SecKeychain? Note that SecKeychainRef itself is likely only a weak reference (if it's an object pointer at all, though it probably is).
Let's assume that one of your objects in fact has a dependency on the SecKeychain object, even if it's indirect and you don't know it. You might therefore have to *not* CFRelease (SecKeychainRef) until the finalize of the object that's dependent on it.
I can't really speculate further on that, because it depends on the API contracts of the various other security-related frameworks objects you're using, and on the implementation of your other objects that we haven't seen.
> Maybe the finalize reference in the crash report is misleading - search for handle_overretained_garbage in the link below:
> http://www.opensource.apple.com/source/libauto/libauto-141.2/AutoZone.cpp?txt
I'm not sure how you'd reach that conclusion from this piece of code. *Something* is being finalized, so why would it be misleading?
> Does the finalize concept even apply in the context of a CFType?
It's not impossible, in certain cases, but it may as well be so, if some other object with a reference to CFType has a finalize.
_______________________________________________
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