The point of these opaque types is that you don't need to know and don't need to care. Apple could change its internals with every release and we wouldn't know (and don't need to). Usually, FooRef
types are pointers to something. Right now, it's defined as:
typedef struct CGContext *CGContextRef;
But what struct CGContext
looks like, we don't know. It looks like it's really a CoreFoundation (and maybe Objective-C) object since there are the usual retain/release functions:
CGContextRef CGContextRetain (CGContextRef c);
void CGContextRelease (CGContextRef c);
The usual CoreFoundation memory naming patterns apply: you don't need to release a CGContextRef
unless it was returned by a function that contains the words Create
or Copy
.