Closed brstgt closed 7 years ago
The pipes cannot be closed immediately as data may remain on the pipe. @kelunik is correct, this PR breaks the basic-command.php
example that uses echo "Hello, world!"
as the command. The IO streams were never leaked, they were closed in the destructor. However for some reason I pulled out the resource and called fclose()
… no idea why I did that. Updated in https://github.com/amphp/process/commit/c07c27f8825edec1c57f5fe03ea1830f415a886c.
You are right. The streams don't leak if the process is dtored correctly. The underlying problem was the leaking of the whole process object. Thanks anyway!
If streams are not closed when child process is finished, the IO streams leak in the loop and may result in infinitely leaked FDs when loop is reset