Fixed: memory leak in XcodeCapp due to NSAppleScript. We now use osascript

This commit is contained in:
Alexandre Wilhelm
2015-11-12 11:59:00 -08:00
parent 372e994617
commit 671ed3c2fe
+12 -6
View File
@@ -28,12 +28,18 @@ static const char *kCloseXcodeProjectScript =
@implementation XcodeProjectCloser
+ (void)closeXcodeProjectForProject:(NSString *)projectPath
{
NSString *format = @(kCloseXcodeProjectScript);
NSString *source = [NSString stringWithFormat:format, projectPath];
NSAppleScript *script = [[NSAppleScript alloc] initWithSource:source];
[script executeAndReturnError:nil];
{
NSString *format = @(kCloseXcodeProjectScript);
NSString *source = [NSString stringWithFormat:format, projectPath];
NSString *arguments = [NSString stringWithFormat:@"-e %@", source];
NSTask *task = [[NSTask alloc] init];
[task setLaunchPath:@"/usr/bin/osascript"];
[task setArguments:[NSArray arrayWithObjects:arguments, nil]];
[task launch];
[task waitUntilExit];
DDLogVerbose(@"Osascript launched for the project %@", projectPath);
}
@end