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: how to set NavDialogCreationOptions strings



On Fri, 30 Jul 2004 03:09:14, Frederick Cheung <email@hidden> wrote:

> On 30 Jul 2004, at 02:40, OL&L Lists wrote:
>
>> Just use the one overriding Core Foundation rule:
>>
>> If you got the strings by calling any routine with "Create" or "Copy"
>> in its name, then you are responsible for releasing those variables.
>> If not, then whomever created them is responsible for doing the
>> release.
>>
> There is the odd exception, in APIs that were created before these
> rules became set in stone. An example is
> GetDataBrowserListViewHeaderDesc, the struct it fills in contains a
> CFStringRef you need to release. I am always a bit wary with functions
> that first appeared during a time when the rules weren't so clear.

Concerning GetDataBrowserListViewHeaderDesc, its wrong name aside,
there should have been the counter part API that releases of the
whole DataBrowserListViewHeaderDesc structure. New releasable fields
might be added to the future versions of this structure (or its
substructures), so it would be convenient to use release API instead
of manually guessing and releasing certain fields. For example it is
not that obvious should the .btnContentInfo.u.picture be released
(and how) when contentType is kControlContentPictHandle. Same with
other handle/ref fields. Just renaming the API to have "Create"
instead of "Get" will not answer this.

Mike
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.




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.