Alex Soto
|
5c10b87637
|
[CoreImage] Add missing property ColorSpace to CIImage (#906)
https://bugzilla.xamarin.com/show_bug.cgi?id=44438
The ColorSpace property is decorated with the CF_RETURNS_NOT_RETAINED
macro, this means it returns an object that follows the CoreFoundation
[Ownership Policy](1) but it does not follow the naming convention
documented in the policy.
The [CF_RETURNS_NOT_RETAINED](2) indicates that the object reference
returned is not owned by the caller, so we should definitely call
CGColorSpaceRetain when obtaining a handle.
Since CGColorSpace is considered into the [MarshalType list](3) the
generated code ends up calling the IntPtr ctor which does the right
thing, [calling CGColorSpaceRetain](4) in the given ptr.
And last but not least, we already bind another property decorated
with [CF_RETURNS_NOT_RETAINED](2) in [CIColor::ColorSpace](5).
[1]: https://developer.apple.com/library/content/documentation/CoreFoundation/Conceptual/CFMemoryMgmt/Concepts/Ownership.html
[2]: http://clang-analyzer.llvm.org/annotations.html#attr_cf_returns_not_retained
[3]: 0bc23b379a/src/generator.cs (L2642)
[4]: https://github.com/xamarin/xamarin-macios/blob/xcode8/src/CoreGraphics/CGColorSpace.cs#L77-L80
[5]: https://github.com/xamarin/xamarin-macios/blob/xcode8/src/coreimage.cs#L112-L113
|
2016-09-28 12:33:51 +02:00 |