Fix compile warning

Fix crash if smc failed to get current authorization during first use
This commit is contained in:
Anakin Zheng
2014-03-25 15:13:47 -04:00
parent 063d53b06c
commit 3dbea4bd98
6 changed files with 68 additions and 31 deletions

View File

@ -27,8 +27,10 @@
- (id)init:(NSString*)p_machine{
machine=[MachineDefaults computerModel];
supported_machines=[[NSArray alloc] initWithContentsOfFile:[[[NSFileManager defaultManager] applicationSupportDirectory] stringByAppendingPathComponent:@"Machines.plist"]];
if (self = [super init]){
machine=[MachineDefaults computerModel];
supported_machines=[[NSArray alloc] initWithContentsOfFile:[[[NSFileManager defaultManager] applicationSupportDirectory] stringByAppendingPathComponent:@"Machines.plist"]];
}
return self;
}
@ -83,7 +85,7 @@
[xmldata writeToFile:[[[NSFileManager defaultManager] applicationSupportDirectory] stringByAppendingPathComponent:@"Machines.plist"] atomically:YES];
[supported_m release];
//return new machine-live-data
return [new_machine retain];
return new_machine;
}