Skip to content

Commit ec93b9a

Browse files
Slamdunkstof
authored andcommitted
[Process] Unset callback after stop to free memory
1 parent fbc353d commit ec93b9a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Symfony/Component/Process/Process.php

+5
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,11 @@ private function close()
11361136
$this->exitcode = 128 + $this->processInformation['termsig'];
11371137
}
11381138

1139+
// Free memory from self-reference callback created by buildCallback
1140+
// Doing so in other contexts like __destruct or by garbage collector is ineffective
1141+
// Now pipes are closed, so the callback is no longer necessary
1142+
$this->callback = null;
1143+
11391144
return $this->exitcode;
11401145
}
11411146

0 commit comments

Comments
 (0)