lockFocus sent to a view whose window is deferred
lockFocus sent to a view whose window is deferred
- Subject: lockFocus sent to a view whose window is deferred
- From: Brian Redman <email@hidden>
- Date: Wed, 9 Oct 2002 02:26:26 -0400
I've hacked my program from 9,000 lines to the 20 that produce the
following errors:
2002-10-09 02:10:19.769 foobar[385] _NXPlaceWindow: error setting
window shape (1000)
2002-10-09 02:10:19.921 foobar[385] _NXPlaceWindow: error setting
window shape (1000)
2002-10-09 02:10:20.073 foobar[385] _NXPlaceWindow: error setting
window shape (1000)
2002-10-09 02:10:20.229 foobar[385] _NXPlaceWindow: error setting
window shape (1000)
2002-10-09 02:10:20.376 foobar[385] _NXPlaceWindow: error setting
window shape (1000)
2002-10-09 02:10:20.531 foobar[385] _NXPlaceWindow: error setting
window shape (1000)
2002-10-09 02:10:20.716 foobar[385] _NXPlaceWindow: error setting
window shape (1000)
2002-10-09 02:10:20.874 foobar[385] _NXPlaceWindow: error setting
window shape (1000)
2002-10-09 02:10:21.030 foobar[385] _NXPlaceWindow: error setting
window shape (1000)
2002-10-09 02:10:21.190 foobar[385] _NXPlaceWindow: error setting
window shape (1000)
2002-10-09 02:10:21.355 foobar[385] _NXPlaceWindow: error setting
window shape (1000)
2002-10-09 02:10:21.509 foobar[385] _NXPlaceWindow: error setting
window shape (1000)
2002-10-09 02:10:21.672 foobar[385] _NXPlaceWindow: error setting
window shape (1000)
2002-10-09 02:10:21.952 foobar[385] _NXCreateWindow: error creating
window (1000)
2002-10-09 02:10:21.954 foobar[385] _initWithWindowNumber: error
creating graphics ctxt object for ctxt:91619, window:-1
2002-10-09 02:10:21.955 foobar[385] *** Assertion failure in -[NSView
lockFocus], AppKit.subproj/NSView.m:2343
2002-10-09 02:10:21.955 foobar[385] An uncaught exception was raised
2002-10-09 02:10:21.955 foobar[385] lockFocus sent to a view whose
window is deferred and does not yet have a corresponding platform window
2002-10-09 02:10:21.955 foobar[385] *** Uncaught exception:
<NSInternalInconsistencyException> lockFocus sent to a view whose
window is deferred and does not yet have a corresponding platform window
I create it in PB with one file no header and in IB instantiate a
subclass of NSObject called Controller.
#import <Cocoa/Cocoa.h>
@interface Controller : NSObject {}
@end
@implementation Controller
- (id)init {
self = [ super init];
return self;
}
- (void)awakeFromNib {
int i;
for (i = 0; i < 5000; i++) {
NSImage *newImage = [[NSImage alloc]
initWithSize:NSMakeSize(15.0, 15.0)];
[ newImage lockFocus];
[ newImage unlockFocus];
}
}
@end
In the debugger i reached 973 on this run but the number of iterations
before crash varies wildly depending
the time of day it's compiled. I've seen as low as 66 and and as high
as 6700.
Is the program above legitimate? If someone cares to engage this I can
go into a lot detail about it.
If it's just a memory footprint problem (~180MB) I'd be surprised not
see an error message give a clue.
newImage is not nil when it crashes.
Running it from finder generates the following console errors (I
removed the repeats):
2002-10-09 02:23:16.400 foobar[394] _NXPlaceWindow: error setting
window shape (1000)
Oct 9 02:23:16 late
/Users/ber/Developer/foobar/build/foobar.app/Contents/MacOS/foobar:
CGSResolveShmemReference : offset exceeds bounds
Oct 9 02:23:16 late
/Users/ber/Developer/foobar/build/foobar.app/Contents/MacOS/foobar:
kCGErrorFailure : _CGSLockWindowGeometry: cannot map shapeRegion shmem
2002-10-09 02:23:16.711 foobar[394] _NXCreateWindow: error creating
window (1000)
2002-10-09 02:23:16.714 foobar[394] _initWithWindowNumber: error
creating graphics ctxt object for ctxt:112283, window:-1
2002-10-09 02:23:16.715 foobar[394] *** Assertion failure in -[NSView
lockFocus], AppKit.subproj/NSView.m:2343
2002-10-09 02:23:16.716 foobar[394] An uncaught exception was raised
2002-10-09 02:23:16.716 foobar[394] lockFocus sent to a view whose
window is deferred and does not yet have a corresponding platform window
2002-10-09 02:23:16.716 foobar[394] *** Uncaught exception:
<NSInternalInconsistencyException> lockFocus sent to a view whose
window is deferred and does not yet have a corresponding platform window
Oct 9 02:23:16 late
/Users/ber/Developer/foobar/build/foobar.app/Contents/MacOS/foobar:
CGSResolveShmemReference : offset exceeds bounds
Oct 9 02:23:16 late
/Users/ber/Developer/foobar/build/foobar.app/Contents/MacOS/foobar:
kCGErrorFailure : CGSBindWindowInfoForWindow: cannot map shmem
Oct 9 02:23:16 late
/Users/ber/Developer/foobar/build/foobar.app/Contents/MacOS/foobar:
kCGErrorIllegalArgument : CGSSetWindowDepth: Invalid window
Oct 9 02:23:16 late
/Users/ber/Developer/foobar/build/foobar.app/Contents/MacOS/foobar:
kCGErrorIllegalArgument : CGSSetWindowAutofill: Invalid window
Oct 9 02:23:16 late
/Users/ber/Developer/foobar/build/foobar.app/Contents/MacOS/foobar:
kCGErrorIllegalArgument : CGSSetWindowOpacity: Invalid window
Oct 9 02:23:16 late WindowServer[186]: CGXGetWindowType: Invalid
window -1
Oct 9 02:23:16 late
/Users/ber/Developer/foobar/build/foobar.app/Contents/MacOS/foobar:
kCGErrorIllegalArgument : CGSGetWindowType
Oct 9 02:23:16 late
/Users/ber/Developer/foobar/build/foobar.app/Contents/MacOS/foobar:
kCGErrorIllegalArgument : CGSLockWindowRectBits: Invalid window
Oct 9 02:23:16 late
/Users/ber/Developer/foobar/build/foobar.app/Contents/MacOS/foobar:
kCGErrorFailure : Failed to create window context device.
Oct 9 02:23:16 late
/Users/ber/Developer/foobar/build/foobar.app/Contents/MacOS/foobar:
kCGErrorFailure : CGWindowContextCreate: failed to create context.
Oct 9 02:23:16 late
/Users/ber/Developer/foobar/build/foobar.app/Contents/MacOS/foobar:
kCGErrorFailure : CGContextResetClip: invalid context
Oct 9 02:23:16 late
/Users/ber/Developer/foobar/build/foobar.app/Contents/MacOS/foobar:
kCGErrorFailure : CGContextReplaceTopGState: invalid context
Oct 9 02:23:16 late crashdump: Crash report written to:
/Users/ber/Library/Logs/CrashReporter/foobar.crash.log
2002-10-09 02:23:17.984 Console[390] Exception raised during posting of
notification. Ignored. exception: *** NSRunStorage,
_NSBlockNumberForIndex(): index (5652) beyond array bounds (5652)
Thanks,
brian
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.