From 2e58387a437848e68ccbf76062492dbb83c830d6 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 8 Aug 2023 14:55:53 +0100 Subject: [PATCH] Fixed thread error capture fail in shutdown function the shutdown handler currently isn't called until join(), which sets isKilled to true and stops the error information from being recorded. --- src/thread/CommonThreadPartsTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thread/CommonThreadPartsTrait.php b/src/thread/CommonThreadPartsTrait.php index 340ce554d..e7429be9b 100644 --- a/src/thread/CommonThreadPartsTrait.php +++ b/src/thread/CommonThreadPartsTrait.php @@ -124,7 +124,7 @@ trait CommonThreadPartsTrait{ */ protected function onShutdown() : void{ $this->synchronized(function() : void{ - if(!$this->isKilled && $this->crashInfo === null){ + if($this->isTerminated() && $this->crashInfo === null){ $last = error_get_last(); if($last !== null){ //fatal error