Merge pull request #655 from flightphp/async-fix

Finally found the horrific memory leak!
master v3.16.1
n0nag0n 3 days ago committed by GitHub
commit f2b4aea5d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -521,6 +521,12 @@ class Engine
if ($this->requestHandled === false) {
// not doing much here, just setting the requestHandled flag to true
$this->requestHandled = true;
// Allow filters to run
// This prevents multiple after events from being registered
$this->after('start', function () use ($self) {
$self->stop();
});
} else {
// deregister the request and response objects and re-register them with new instances
$this->unregister('request');
@ -535,11 +541,6 @@ class Engine
$response = $this->response();
$router = $this->router();
// Allow filters to run
$this->after('start', function () use ($self) {
$self->stop();
});
if ($response->v2_output_buffering === true) {
// Flush any existing output
if (ob_get_length() > 0) {

Loading…
Cancel
Save