Re: multithreading, cocoa, pools and POSIX
Re: multithreading, cocoa, pools and POSIX
- Subject: Re: multithreading, cocoa, pools and POSIX
- From: Luc Vandal <email@hidden>
- Date: Tue, 07 Jun 2005 13:41:55 -0400
I've removed [notif autorelease] but I still get a crash on [pool
release];
#0 0x908311f4 in objc_msgSend
#1 0x90a21f3c in NSPopAutoreleasePool
#2 0x000129d8 in Text_Feed_Callback(_VR_TEXT_FEED_PARAM*, void*) at
callbacks.mm:150
Is it because I'm using NSAutoreleasePool in a thread? I've set Cocoa
to run in multithread mode.
Luc
On 7-Jun-05, at 1:31 PM, Philip George wrote:
when you use the alloc/initXXX pair, **you** deal with cleanup.
otherwise (as in your case), just make sure there's an available
autorelease pool, which you've got.
- philip
On Jun 7, 2005, at 12:28 PM, Luc Vandal wrote:
Ok!
I did that according to the sample given in the "Autorelease Pool"
doc:
void main()
{
NSArray *args = [[NSProcessInfo processInfo] arguments];
unsigned count, limit = [args count];
for (count = 1; count < limit; count++){
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *fileContents;
NSString *fileName;
fileName = [args objectAtIndex:count];
fileContents = [[NSString alloc]
initWithContentsOfFile:fileName];
[fileContents autorelease];
/* Process the file, creating and autoreleasing more objects.
*/
[pool release];
}
/* Do whatever cleanup is needed. */
exit (EXIT_SUCCESS);
}
Luc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden