[Process] Close pipes before calling proc_close to avoid deadlocks as advised on the proc_close php.net documentation

This commit is contained in:
Jordi Boggiano 2012-04-08 20:27:37 +02:00
parent f4227b5f82
commit e82a05d3e7

View File

@ -503,6 +503,12 @@ class Process
$time += 1000;
usleep(1000);
}
foreach ($this->pipes as $pipe) {
fclose($pipe);
}
$this->pipes = array();
$exitcode = proc_close($this->process);
$this->exitcode = -1 === $this->processInformation['exitcode'] ? $exitcode : $this->processInformation['exitcode'];
}