I'm working on a framework and am encountering a frustrating problem.
When I attempt to free the autorelease pool, the program crashes with
a segmentation fault.
It has to be related to the initWithSerialDeviceFileName code, as
allocating and initializing the base class of GDFreestyleMeter,
GDMeter, works properly. Specifically, the problem appears to center
on the "meterDevice = [NSFileHandle
fileHandleForUpdatingAtPath:deviceFile];" line in
initWithSerialDeviceFileName, as commenting that out allows the
program to quit successfully, at the cost of not doing anything useful.
What am I doing wrong?
- (id)initWithSerialDeviceFileName:(NSString*)deviceFile
{
if(self = [super init])
{
meterDevice = [NSFileHandle
fileHandleForUpdatingAtPath:deviceFile];
if(meterDevice == nil)
{
NSException* noFile = [NSException
exceptionWithName:@"SerialPortDoesNotExistException" reason:@"The
serial port specified does not exist" userInfo:[NSDictionary
dictionaryWithObject:deviceFile forKey:@"devicePath"]];
[noFile raise];
}
[self setSerialPortOptions];
}
return self;
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden