mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-25 10:01:00 +00:00
After update try relaunching for 1 second on macOS.
This commit is contained in:
parent
846499a4fb
commit
a95a055acd
@ -266,18 +266,24 @@ int main(int argc, const char * argv[]) {
|
|||||||
[args addObject:workDir];
|
[args addObject:workDir];
|
||||||
}
|
}
|
||||||
writeLog([[NSArray arrayWithObjects:@"Running application '", appPath, @"' with args '", [args componentsJoinedByString:@"' '"], @"'..", nil] componentsJoinedByString:@""]);
|
writeLog([[NSArray arrayWithObjects:@"Running application '", appPath, @"' with args '", [args componentsJoinedByString:@"' '"], @"'..", nil] componentsJoinedByString:@""]);
|
||||||
NSError *error = nil;
|
|
||||||
NSRunningApplication *result = [[NSWorkspace sharedWorkspace]
|
for (int i = 0; i < 5; ++i) {
|
||||||
|
NSError *error = nil;
|
||||||
|
NSRunningApplication *result = [[NSWorkspace sharedWorkspace]
|
||||||
launchApplicationAtURL:[NSURL fileURLWithPath:appPath]
|
launchApplicationAtURL:[NSURL fileURLWithPath:appPath]
|
||||||
options:NSWorkspaceLaunchDefault
|
options:NSWorkspaceLaunchDefault
|
||||||
configuration:[NSDictionary
|
configuration:[NSDictionary
|
||||||
dictionaryWithObject:args
|
dictionaryWithObject:args
|
||||||
forKey:NSWorkspaceLaunchConfigurationArguments]
|
forKey:NSWorkspaceLaunchConfigurationArguments]
|
||||||
error:&error];
|
error:&error];
|
||||||
if (!result) {
|
if (result) {
|
||||||
|
closeLog();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
writeLog([[NSString stringWithFormat:@"Could not run application, error %ld: ", (long)[error code]] stringByAppendingString: error ? [error localizedDescription] : @"(nil)"]);
|
writeLog([[NSString stringWithFormat:@"Could not run application, error %ld: ", (long)[error code]] stringByAppendingString: error ? [error localizedDescription] : @"(nil)"]);
|
||||||
|
usleep(200000);
|
||||||
}
|
}
|
||||||
closeLog();
|
closeLog();
|
||||||
return result ? 0 : -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user