Skip to content

Commit

Permalink
shortened relaunch NSTask invocation
Browse files Browse the repository at this point in the history
  • Loading branch information
mstarke committed Nov 23, 2022
1 parent 29756c0 commit bee3766
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions MacPass/NSApplication+MPAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,9 @@ - (NSURL *)applicationSupportDirectoryURL:(BOOL)create {
}

- (void)relaunchAfterDelay:(CGFloat)seconds {
NSTask *task = [[NSTask alloc] init];
task.launchPath = @"/bin/sh";
task.arguments = @[ @"-c", [NSString stringWithFormat:@"sleep %f; open \"%@\"", seconds, NSBundle.mainBundle.bundlePath] ];
[task launch];
[self terminate:nil];
NSArray *args = @[@"-c", [NSString stringWithFormat:@"sleep %f; open \"%@\"", seconds, NSBundle.mainBundle.bundlePath]];
[NSTask launchedTaskWithLaunchPath:@"/bin/sh" arguments:args];
[self terminate:self];
}

- (MPAppDelegate *)mp_delegate {
Expand Down

0 comments on commit bee3766

Please sign in to comment.