Mailing Lists: Apple Mailing Lists

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

Releasing a Layer and It's Context



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);


The crash log looks like this:

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_INVALID_ADDRESS (0x0001) at 0x63657350

Thread 0 Crashed:
0 <<00000000>> 0x63657350 0 + 1667593040
1 com.apple.CoreGraphics 0x90412af8 contextDelegateFinalize + 44
2 com.apple.CoreFoundation 0x9072a8d4 _CFRelease + 240
3 com.apple.CoreGraphics 0x904043b8 contextFinalize + 96
4 com.apple.CoreFoundation 0x9072a8d4 _CFRelease + 240
5 com.apple.CoreFoundation 0x9072a8d4 _CFRelease + 240


Thanks,
Nick
_______________________________________________
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.