Important: The information in this document is obsolete and should not be used for new development.
CMGetProfileRefCount
Obtains the current reference count for the specified profile.
pascal CMError CMGetProfileRefCount ( CMProfileRef prof, long *count);
prof
- A profile reference (page 3-63) to the profile whose reference count is obtained.
count
- A pointer to a reference count. On output, the reference count for the specified profile reference.
- function result
- A result code of type CMError. See "Result Codes" (page 3-174) for a list of ColorSync-specific result codes.
DISCUSSION
The ColorSync Manager keeps an internal reference count for each profile reference returned from calls such asCMOpenProfile
orCMNewProfile
. Calling the CMCloneProfileRef function (page 3-78) increments the count; calling theCMCloseProfile
function (page 3-71) decrements it. The profile remains open as long as the reference count is greater than 0, indicating at least one routine retains a reference to the profile. When the count reaches 0, the ColorSync Manager releases all memory, files, or resources allocated in association with that profile.An application that manages profiles closely can call the CMGetProfileRefCount function to obtain the reference count for a profile reference, then perform special handling if necessary, based on the reference count.
SEE ALSO
To copy a profile with theCMCopyProfile
function (page 3-76), you must obtain a reference to that profile by either opening the profile or creating it. To open a profile, use theCMOpenProfile
function (page 3-69). To create a new profile, use theCMNewProfile
function (page 3-75). As an alternative to using theCMCopyProfile
function to duplicate an entire profile, you can use the same profile reference more than once. To do so, you call theCMCloneProfileRef
function (page 3-78) to increment the reference count for the reference each time you reuse it. Calling the CMCloneProfileRef function increments the count; calling theCMCloseProfile
function (page 3-71) decrements it. The profile remains open as long as the reference count is greater than 0, indicating that at least one routine retains a reference to the profile.