NSTask autorelease OR retain/release -> SIGBUS
NSTask autorelease OR retain/release -> SIGBUS
- Subject: NSTask autorelease OR retain/release -> SIGBUS
- From: Seth Delackner <email@hidden>
- Date: Thu, 3 Apr 2003 23:59:43 +0000
- Mail-followup-to: email@hidden
This should not happen:
1. call doFoo. Runs fine.
2. call doFoo a second time.
a. If on line (A) I autorelease the task, we crash SIGBUS.
b. If on line (A) I retain, then at line (B) release, SIGBUS.
c. If I simply leave it as listed below, "leaking", it runs fine.
This isn't the actual code, but it seems to be the relevent portion. The
NSTask is not referenced ANYWHERE else in the program.
foo.m:
static NSTask* myTask;
+ (void)doFoo{
NSString* myPath = "/my/binary/path";
myTask = [[NSTask alloc] init]; // (A)
[myTask setLaunchPath: myPath];
[myTask setArguments: [NSArray arrayWithObjects: @"first", nil]];
[myTask launch];
[myTask waitUntilExit];
// (B)
myTask = nil;
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.