Re: NSThread question
Re: NSThread question
- Subject: Re: NSThread question
- From: "Mike Vannorsdel" <email@hidden>
- Date: Tue, 10 Jul 2001 03:29:35 -0600
You're missing an autorelease pool for your thread. Create one like
this:
- (void)display
{
NSAutoreleasePool * localPool = [[NSAutoreleasePool alloc] init];
//your display code here
[localPool release];
}
Newly created threads don't have an autorelease pool for autoreleased
objects to go to. That's why you need to create one for additional
threads.
On Tuesday, July 10, 2001, at 02:47 AM, Candide Kemmler wrote:
Hi,
I have a button (several of them actually) which triggers a long
rendering. My application not being multithreaded, the button stays
blue for a long while, until the rendering's finished. I tried to do:
[ NSThread detachNewThreadSelector:@selector(display) toTarget:self
withObject:nil ];
But then I get
Jul 10 10:46:50 TT[979] *** _NSAutoreleaseNoPool(): Object 0x145d390 of
class NSBezierPath autoreleased with no pool in place - just leaking
Jul 10 10:46:50 TT[979] *** _NSAutoreleaseNoPool(): Object 0x145d3f0 of
class NSBezierPath autoreleased with no pool in place - just leaking
Jul 10 10:46:50 TT[979] *** _NSAutoreleaseNoPool(): Object 0x145d300 of
class NSCalibratedRGBColor autoreleased with no pool in place - just
leaking
What's wrong with my call ?
Candide
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev