Re: Object Allocations
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