• 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: Object Allocations
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Object Allocations


  • Subject: Re: Object Allocations
  • From: Ondra Cada <email@hidden>
  • Date: Mon, 17 Sep 2001 15:54:06 +0200

Rosyna,

>>>>>> Rosyna (R) wrote at Mon, 17 Sep 2001 06:30:24 -0700:
R> Yup and it happens when its done with the thread, even though i
R> explicitly make an Auto Release pool.

Did you do that _in the thread_?

This pattern should work (always worked for me, so far, in a number of
multithreaded apps):

-(void)thread {
id pool=[NSAutoreleasePool new];
...
[pool release];
}
...
[NSThread detachNewThreadSelector:@selector(thread) toTarget:self withObject:nil];
...

This pattern would _not_ work:

-(void)thread { ... }
...
id pool=[NSAutoreleasePool new];
[NSThread detachNewThreadSelector:@selector(thread) toTarget:self withObject:nil];
[pool release];
...
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc


References: 
 >Re: Object Allocations (From: "John C. Randolph" <email@hidden>)
 >Re: Object Allocations (From: Rosyna <email@hidden>)

  • Prev by Date: Re: Object Allocations
  • Next by Date: Re: Programatically opening an NSDocument subclass ??
  • Previous by thread: Re: Object Allocations
  • Next by thread: MADH and Cocoa...
  • Index(es):
    • Date
    • Thread