소스 검색

Merge pull request #95191 from bruvzg/macos_term

[macOS] Attempt to terminate process normally before using `forceTerminate`.
Rémi Verschelde 1 년 전
부모
커밋
4577b37036
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      platform/macos/os_macos.mm

+ 5 - 2
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 {