• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSThread question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSThread question (From: Candide Kemmler <email@hidden>)

  • Prev by Date: Re: Security framework question
  • Next by Date: Copy via Pasteboard
  • Previous by thread: NSThread question
  • Next by thread: Re: NSThread question
  • Index(es):
    • Date
    • Thread