On Friday, 7 September 2018 at 14:36:42 UTC, Russel Winder wrote:
From what I can see, processes created with std.process: spawnProcess are not terminated when the creating process terminates, i.e. it seems Config.detached is the default for these process.

Is there a way of all spawned processes being terminated on main termination?




void main()
{

...
auto yourpid = spawnProcess(...);
scope(exit) kill(yourpid, SIGINT); // Or SIGKILL :)
// Or: scope(exit) wait(yourpid);
...
}

Andrea

Reply via email to