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 protected])
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]