Skip to content

Commit

Permalink
[Process] Unset callback after stop to free memory
Browse files Browse the repository at this point in the history
  • Loading branch information
Slamdunk authored and stof committed Dec 5, 2015
1 parent fbc353d commit ec93b9a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Symfony/Component/Process/Process.php
Expand Up @@ -1136,6 +1136,11 @@ private function close()
$this->exitcode = 128 + $this->processInformation['termsig'];
}

// Free memory from self-reference callback created by buildCallback
// Doing so in other contexts like __destruct or by garbage collector is ineffective
// Now pipes are closed, so the callback is no longer necessary
$this->callback = null;

return $this->exitcode;
}

Expand Down

0 comments on commit ec93b9a

Please sign in to comment.