From 41151e6975104585f5fb44cca34688e7e058825c Mon Sep 17 00:00:00 2001 From: Fredrik Rombach Ekelund Date: Tue, 5 May 2026 15:19:35 +0200 Subject: [PATCH] Close `ProcessOutputStream` in `Runtime::eval_php_code_in_subprocess` --- components/Blueprints/class-runtime.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/Blueprints/class-runtime.php b/components/Blueprints/class-runtime.php index 4896f9cda..b9cfdcb27 100644 --- a/components/Blueprints/class-runtime.php +++ b/components/Blueprints/class-runtime.php @@ -219,7 +219,13 @@ public function eval_php_code_in_subprocess( $process = $this->create_php_sub_process( $code, $env, $input, $timeout ); $process->mustRun(); - $output = $process->getOutputStream( Process::OUTPUT_FILE )->consume_all(); + $output_stream = $process->getOutputStream( Process::OUTPUT_FILE ); + try { + $output = $output_stream->consume_all(); + } finally { + $output_stream->close_reading(); + } + return new EvalResult( $output, $process