Skip to content

Conversation

7-zete-7
Copy link

Fixes #116

The Process::close() method contains a block introducing side effects (see

foreach ($this->pipes as $pipe) {
$pipe->close();
}
). One of the possible side effects may be a repeated call to the Process::close() method. Due to the deferred protection against double execution of the method (below the block with potential side effects, see
$this->process = null;
), the Process::close() method may be run again. The second execution of the Process::close() method will work correctly, but the first will encounter an error about the absence of a resource in the Process::$process property (this property was set to null during the second execution).

With this change, the protection against double execution of the Process::close() method is moved to the very beginning of the method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant