On Mar 12, 2011, at 11:41, [email protected] 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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to