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.
This commit is contained in:
Dylan K. Taylor 2023-08-08 14:55:53 +01:00
parent 35a28300f6
commit 2e58387a43
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -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