Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: To CFRelease or not to CFRelease a CFString in Spotlight Importer




On 26 May 2005, at 16:50, Roch M. Comeau wrote:


I figured that the problem may be that the CFString is not being retained properly when using CFStringCreateWithFormat (or WithCString) so it gets deleted when I release it. This would be contrary to the documentation. I printed out the retain counts after creating the string, after appending it to the array and after releasing the string. With CFStringCreateCopy I get 2, 2, 1 and with CFStringCreateWithFormat I get 1,1,1 respectively. Neither of these makes sense but I made a separate test App and get the same numbers.

How are you creating the array? The retain count not changing when you add it to the array seems to indicate that you aren't using array callbacks that retain stuff added to the array. Other than that the retain count sequences seem reasonable.


Fred

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >To CFRelease or not to CFRelease a CFString in Spotlight Importer (From: "Roch M. Comeau" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.