From 393741a7e21230c8664ae34e077d28c15a58af0d Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Tue, 6 Aug 2024 12:45:56 +0300 Subject: [PATCH] [macOS] Attempt to terminate process normally before using `forceTerminate`. --- platform/macos/os_macos.mm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/platform/macos/os_macos.mm b/platform/macos/os_macos.mm index 078be53a8d7..495246344bd 100644 --- a/platform/macos/os_macos.mm +++ b/platform/macos/os_macos.mm @@ -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 {