If a process has children, kill the parent won’t be enough to guarantee “on orphaned process”. You basically have to recursively kill all the children process as well.

Here is the way to do it.