Re: Object Allocations
Re: Object Allocations
- Subject: Re: Object Allocations
- From: Rosyna <email@hidden>
- Date: Mon, 17 Sep 2001 20:03:59 -0700
This is the EXACT same situation I have, the same error messages and
everything (NSCalibratedRGBColor and NSCFString)
Ack, at 9/17/01, Rainer Brockerhoff said:
// subclassed NSDocument, when opening a document:
// shouldThread is a BOOL instance variable set from preferences.
if (shouldThread) {
[NSApplication detachDrawingThread:@selector(startPlugin:)
toTarget:self withObject:plugin];
} else {
[self startPlugin:plugin];
}
- (void)startPlugin:(id)plugin {
NSAutoreleasePool* pool = nil;
if (shouldThread) {
pool = [[NSAutoreleasePool alloc] init];
}
[plugin doStuff];
[pool release];
}
As I said, it's intermittent. This may not be pertinent to the
problem, but the error message (NSAutoReleaseNoPool IIRC) always
refers to a NSCFString and an NSCalibratedRGBColor, it happens only
for the first opened document, and most - perhaps all - instances I
remember seeing happened when the document was opened from within a
drag&drop receiver.
The shouldThread variable is set very early when the document is
created and never changes afterwards. Even if some evil influence
changed it between detachDrawingThread and the test before the
NSAutoreleasePool, _all_ temporary objects created by doStuff would
be pool-less, not just the two which appear in the messages.
--
Sincerely,
Rosyna Keller
Technical Support/Holy Knight/Always needs a hug
Unsanity: Unsane Tools for Insane People