I know that there are many questions and answers about this, but I am looking for an effective and reliable solution. I need to kill a process and all its child processes from a Cocoa application. I got the process id and what I'm going to execute the code is to execute the kill command
kill
from my application ... but it seems terribly boorish and cruel to me. Isn't there a better solution? Carbon KillProcess () and his process manager friends do not seem very useful unless I myself create a process tree view. Did I miss something?
I also have code to send an Apple Quit event based on PID. It would be even nicer to send this to each process in the tree defined by the parent process, from the bottom up. But it is only nice. The answer to the first question is the "point".
source share