![]() |
CMCloneProfileRef |
||||
Header: | CMApplication.h | Carbon status: | Supported | |
Increments the reference count for the specified profile reference.
CMError CMCloneProfileRef ( CMProfileRef prof );
A profile reference of type CMProfileRef to the profile whose reference count is incremented.
The ColorSync Manager keeps an internal reference count for each profile reference returned from a call to the CMOpenProfile, CMNewProfile, or CMCopyProfile functions. Calling the CMCloneProfileRef function increments the count; calling the function CMCloseProfile 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. When the count reaches 0, the ColorSync Manager releases all private memory, files, or resources allocated in association with that profile.
When your application creates a copy of an entire profile with CMCopyProfile, the copy has its own reference count. The CMCloseProfile routine should be called for the copied profile, just as for the original. When the reference count reaches 0, private resources associated with the copied profile are freed.
When your application merely duplicates a profile reference, as it may do to pass a profile reference to a synchronous or an asynchronous task, it should call CMCloneProfileRef to increment the reference count. Both the called task and the caller should call CMCloseProfile when finished with the profile reference.
In your application, you must make sure that CMCloseProfile is called once for each time a profile reference is created or cloned. Otherwise, the memory and resources associated with the profile reference may not be properly freed, or an application may attempt to use a profile reference that is no longer valid.
Supported in Carbon. Available in Carbon 1.0.2 and later when ColorSync 2.1 or later is present.
© 2000 Apple Computer, Inc. (Last Updated 7/17/2000)