[Process] Unset callback after stop to free memory

This commit is contained in:
Filippo Tessarotto 2015-12-02 10:09:02 +01:00 committed by Christophe Coevoet
parent fbc353dcda
commit ec93b9a7f7
1 changed files with 5 additions and 0 deletions

View File

@ -1136,6 +1136,11 @@ class Process
$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;
}