sheredom / subprocess.h

🐜 single header process launching solution for C and C++
The Unlicense
1.12k stars 97 forks source link

windows: close child process's pipe handles at join/destroy time #8

Closed cdwfs closed 4 years ago

cdwfs commented 4 years ago

Based on a Stack Overflow thread, I think the child process's end of the pipes need to be manually closed when the process ends, in order for the parent's ends to register EOF events. Otherwise, they just hang waiting for more output that can never arrive (as shown in the tests I added).

I think my fix here is correct, but I've only tested on Windows.

sheredom commented 4 years ago

Thanks for this buddy!