mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-27 14:07:03 +00:00
Fixed: memory leak in XcodeCapp due to NSAppleScript. We now use osascript
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user