[macOS] Attempt to terminate process normally before using forceTerminate.

This commit is contained in:
bruvzg 2024-08-06 12:45:56 +03:00
parent 3978628c6c
commit 393741a7e2
No known key found for this signature in database
GPG key ID: 7960FCF39844EC38

View file

@ -680,8 +680,11 @@ Error OS_MacOS::kill(const ProcessID &p_pid) {
if (!app) {
return OS_Unix::kill(p_pid);
}
return [app forceTerminate] ? OK : ERR_INVALID_PARAMETER;
bool terminated = [app terminate];
if (!terminated) {
terminated = [app forceTerminate];
}
return terminated ? OK : ERR_INVALID_PARAMETER;
}
String OS_MacOS::get_unique_id() const {