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-05, at 11:57 AM, Frederick Cheung wrote:

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


I was passing NULL as the  in CFArrayCreateMutable and presume that the default behaviour was to retain the string when I append it to the array. After reviewing the documentation again, I realize that I should have passed kCFTypeArrayCallBacks instead so it would treat all objects appended as CF objects. Changing that solved my problem, and the retain count looks correct now as well! I guess I got confused with the observation that CFStringCreateCopy seemed to work while the others did not.

I was scratching my head for days over this!

Thanks!

Roch

 _______________________________________________
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>)
 >Re: To CFRelease or not to CFRelease a CFString in Spotlight Importer (From: Frederick Cheung <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.