Skip to content

Commit 393741a

Browse files
committed
[macOS] Attempt to terminate process normally before using forceTerminate.
1 parent 3978628 commit 393741a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

platform/macos/os_macos.mm

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,8 +680,11 @@
680680
if (!app) {
681681
return OS_Unix::kill(p_pid);
682682
}
683-
684-
return [app forceTerminate] ? OK : ERR_INVALID_PARAMETER;
683+
bool terminated = [app terminate];
684+
if (!terminated) {
685+
terminated = [app forceTerminate];
686+
}
687+
return terminated ? OK : ERR_INVALID_PARAMETER;
685688
}
686689

687690
String OS_MacOS::get_unique_id() const {

0 commit comments

Comments
 (0)