Open klemens-morgenstern opened 4 years ago
As a trivial example, why we must terminate in the constructor, the following code causes a deadlock if we wait in the destructor.
std::opstream pin: std::ipstream pout; std::process proc{"python", std::process_io(pin, pout)}; throw 42;
The python process will wait for the pipe to close (or the exit command), but the pipe will be closed after the process is destruced.
As a trivial example, why we must terminate in the constructor, the following code causes a deadlock if we wait in the destructor.
The python process will wait for the pipe to close (or the exit command), but the pipe will be closed after the process is destruced.