Synthesize getter in a NSThread
Synthesize getter in a NSThread
- Subject: Synthesize getter in a NSThread
- From: Tony Romano <email@hidden>
- Date: Sat, 21 May 2011 13:27:27 -0700
- Thread-topic: Synthesize getter in a NSThread
I am running into an issue using a synthesized getter in a thread.
Observing memory consumed by the application in Activity Monitor, memory
continues to grow ~200k per sample until the OS gives an Out Of Memory
warning. If I code my own getter, the app behaves as expected. I have
striped it down to basically one call as follows:
-(void) process:(LeakyThreadAppDelegate *) myDelegate
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
// Extract the object that contains the thread object
SomeClass *obj = [myDelegate myClass];
NSLog(@"Thread Starting");
// Simplified to illustrate the problem
while (1) {
if ([[obj thread] isCancelled] == YES) {
break;
}
}
NSLog(@"Thread Cancelled");
[pool release];
}
Any clues as to what is wrong? Thanks In Advance.
I have created a complete sample and pushed it up to GitHub:
git://github.com/tonyrom/Leaky-Getter-Sample-Code.git
-tony
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden