Re: NSGraphicsContext PDF crash
Re: NSGraphicsContext PDF crash
- Subject: Re: NSGraphicsContext PDF crash
- From: Wim Lewis <email@hidden>
- Date: Mon, 3 Jan 2011 16:25:08 -0800
On 3 Jan 2011, at 4:10 PM, Wesley Smith wrote:
> Then, I do
>
> [NSGraphicsContext setCurrentContext:ctx];
> [[NSColor blackColor] set];
> NSBezierPath *p = [[NSBezierPath bezierPath] retain];
> [p lineToPoint:NSMakePoint(100, 100)]; // <----------------- crashes here
> [p stroke];
>
>
> Top of the stack on crash:
> #0 0x1726448f in PDFContentStreamDrawPath
> #1 0x17264ec6 in pdf_DrawPath
> #2 0x9845f545 in rips_DrawPath
> #3 0x900dd7af in CGContextDrawPath
> #4 0x900dd6fa in CGContextFillPath
> #5 0x9009db5c in CGContextFillRect
> #6 0x9087b072 in CUIRenderer::DrawWindowFrameDark
> #7 0x9087dc2f in CUIRenderer::Draw
> #8 0x92f06230 in _NSDrawThemeBackground
> #9 0x92fcd63b in -[NSGrayFrame drawWindowBackgroundRegion:]
> <snip>
Are you sure this crash corresponds to your code? It looks like this is crashing when Cocoa tries to draw a window border, but the lowest-level frames are PDF-related. Are you perhaps allowing the NSGraphicsContext to outlive the CGPDFGraphicsContext it references?
_______________________________________________
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