ConsoleReaderThread: fixed zombie process leak

This commit is contained in:
Dylan K. Taylor 2021-11-29 23:45:10 +00:00
parent 4a8ca603a1
commit 882df94bcb
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -31,6 +31,7 @@ use function base64_encode;
use function fgets; use function fgets;
use function fopen; use function fopen;
use function preg_replace; use function preg_replace;
use function proc_close;
use function proc_open; use function proc_open;
use function proc_terminate; use function proc_terminate;
use function sprintf; use function sprintf;
@ -130,6 +131,7 @@ final class ConsoleReaderThread extends Thread{
//gets stuck in a blocking fgets() read because stream_select() is a hunk of junk (hence the separate process in //gets stuck in a blocking fgets() read because stream_select() is a hunk of junk (hence the separate process in
//the first place). //the first place).
proc_terminate($sub); proc_terminate($sub);
proc_close($sub);
stream_socket_shutdown($client, STREAM_SHUT_RDWR); stream_socket_shutdown($client, STREAM_SHUT_RDWR);
} }