The following code crashes in CGLayerRelease when provided a basic
window context (i.e., inContext). Can anybody tell me what's wrong
here? According to the documentation, the caller is responsible for
releasing the context returned by CGLayerGetContext(). FWIW, it
doesn't make any difference if I draw into the layer or not.
.
CGSize layerSize = {100.0, 100.0};
CGLayerRef layer = CGLayerCreateWithContext(inContext, layerSize,
nil);
CGContextRef layerContext = CGLayerGetContext(layer);
CGContextRelease(layerContext);
CGLayerRelease(layer);
Thought we never called release on "Get" APIs -- only on Create and
Copy APIs?
"If you create, copy, or retain a Core Foundation object, you alone are
responsible for releasing it when you no longer need it. If you did not
directly create or copy the object, you do not own it and should not
release it."
...
"Important: Never release an object that you don’t own, such as an
object returned from a Get function. Doing so could have serious and
unpredictable consequences, such as runtime errors."
_______________________________________________
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