Re: CoreFoundation object over-retained during finalization
Re: CoreFoundation object over-retained during finalization
- Subject: Re: CoreFoundation object over-retained during finalization
- From: "email@hidden" <email@hidden>
- Date: Sat, 12 Mar 2011 20:31:33 +0000
On 12 Mar 2011, at 20:11, Quincey Morris wrote:
> 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).
mySSLIdentity is of type SecIdentityRef and is obtained by searching the keychain.
There is nothing in the docs to suggest that it retains any reference to its source keychain.
> 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.
The docs explicitly state that the SecKeychain object should be released via CFRelease.
>> 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?
I mean in the sense of the error arising as a direct result of an NSObject instance receiving a finalize message.
Regards
Jonathan_______________________________________________
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