Mailing Lists: Apple Mailing Lists

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

CGShadingCreateAxial retains CGFunctionRef?



Hi,

The docs for CGShadingCreateAxial don't mention if the CGFunctionRef passed to it is retained by the shading or not.

At the moment (10.4.1) it seems that CGShadingCreateAxial is retaining the CGFunctionRef (or only using it before the create function returns), as I can release it after passing it to CGShadingCreateAxial and everything behaves. Is this behaviour guaranteed, or just an aspect of the current implementation?

My current code is:

CGColorSpaceRef colorspace = CGColorSpaceCreateWithName (kCGColorSpaceGenericRGB);

    CGFunctionRef function = CGFunctionCreate ((void *) components,
                                               1,
                                               input_value_range,
                                               components,
                                               output_value_ranges,
                                               &callbacks);

    CGShadingRef shading = CGShadingCreateAxial (colorspace,
                                                 startPoint, endPoint,
                                                 function,
                                                 true, true);

CGColorSpaceRelease(colorspace); //Docs specify that this is retained by the CGShadingRef
CGFunctionRelease(function); //Don't know if this is safe



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

This email sent to 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.