Skip to content

Commit 3c7d670

Browse files
Merge pull request #41 from PhiloNL/patch-1
Fix memory leak when using Laravel Octane
2 parents e69530e + b76c2eb commit 3c7d670

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Middleware/RenderTorchlight.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ public function handle(Request $request, Closure $next)
3131
return $response;
3232
}
3333

34-
return BladeManager::renderResponse($response);
34+
$response = BladeManager::renderResponse($response);
35+
36+
// Clear blocks from memory to prevent memory leak when using Laravel Octane
37+
BladeManager::clearBlocks();
38+
39+
return $response;
3540
}
3641

3742
protected function handleLivewireRequest(JsonResponse $response)

0 commit comments

Comments
 (0)