It is possible to child process be killed when exit app without coding?

I would like to kill all child_processes instances when app is crash, close or whenever app is ending run, I was tried spawn, exec but after close app process still working on background.