Re: NSGraphicsContext restore crashes my xtension
Re: NSGraphicsContext restore crashes my xtension
- Subject: Re: NSGraphicsContext restore crashes my xtension
- From: Ken Tozier <email@hidden>
- Date: Sun, 27 Jul 2008 21:05:20 -0400
On Jul 27, 2008, at 7:09 PM, glenn andreas wrote:
If you call [NSGraphicsContext currentContext] before your
setCurrentContext:, what do you get back?
Whatever that is, that's the context to restore with a second
[NSGraphicsContext setCurrentContext: ] at the end...
Pay no attention to what the CGGraphicsContext is - there is no
such thing as a "current" CGGraphicsContext (since
CGGraphicsContext routines all take the context as an explicit
parameter) - it's only the implicit NSGraphicsContext that matters.
Thanks Glenn.
Saving/restoring the context with
*oldContext = [NSGraphicsContext currentContext];
[NSGraphicsContext setCurrentContext: oldContext];
Did the trick. No more crashes.
Thanks again.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden