fix: ensure env is not in an invalid state on shutdown (#1442)

This commit is contained in:
Alexander Stecher
2025-03-19 13:22:06 +01:00
committed by GitHub
parent 9cca12858b
commit 432824edf1

View File

@@ -501,6 +501,11 @@ static zend_module_entry frankenphp_module = {
STANDARD_MODULE_PROPERTIES};
static void frankenphp_request_shutdown() {
if (is_worker_thread) {
/* ensure $_ENV is not in an invalid state before shutdown */
zval_ptr_dtor_nogc(&PG(http_globals)[TRACK_VARS_ENV]);
array_init(&PG(http_globals)[TRACK_VARS_ENV]);
}
php_request_shutdown((void *)0);
frankenphp_free_request_context();
}