Merge pull request #95191 from bruvzg/macos_term

[macOS] Attempt to terminate process normally before using `forceTerminate`.
This commit is contained in:
Rémi Verschelde 2024-08-06 12:32:22 +02:00
commit 4577b37036
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

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