Re: "unlockFocus called too many time" console message
Re: "unlockFocus called too many time" console message
- Subject: Re: "unlockFocus called too many time" console message
- From: James Walker <email@hidden>
- Date: Tue, 11 Aug 2009 14:56:30 -0700
I wrote:
When a modeless Cocoa window is closed by clicking the close widget, I
see a console message saying "unlockFocus called too many time." (sic).
It doesn't happen if the window is closed using the File:Close menu
item. I set a breakpoint on NSLog, and saw a stack starting like this:
NSLog
-[NSView unlockFocus]
-[NSControl mouseDown]
-[_NSThemeWidget mouseDown]
-[NSWindow sendEvent:]
carbonAppWindowMouseHandler
(none of which is my code) Does this look like an OS bug? (10.5.7)
For the record, I tracked this down a function of mine that was using
NSGraphicsContext to do Cocoa drawing in a Carbon window. Once I
surrounded the code with [NSGraphicsContext saveGraphicsState] and
[NSGraphicsContext restoreGraphicsState], no more ungrammatical console
messages, and also some sporadic crashes seem to be fixed.
--
James W. Walker, Innoventive Software LLC
<http://www.frameforge3d.com/>
_______________________________________________
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