From e16ce839bf38e55906bf5cc853a5a3ca4715924e Mon Sep 17 00:00:00 2001 From: twosee Date: Mon, 19 Jul 2021 14:31:24 +0800 Subject: [PATCH] Fix memory error on shutdown (PHP-8.1) Ref of function_name was held by zend_fcall_info_init(). --- ext-src/php_swoole.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/ext-src/php_swoole.cc b/ext-src/php_swoole.cc index 54ef17cee85..db467313060 100644 --- a/ext-src/php_swoole.cc +++ b/ext-src/php_swoole.cc @@ -306,7 +306,6 @@ void php_swoole_register_shutdown_function(const char *function) { zend_fcall_info_init( &function_name, 0, &shutdown_function_entry.fci, &shutdown_function_entry.fci_cache, NULL, NULL); register_user_shutdown_function(Z_STRVAL(function_name), Z_STRLEN(function_name), &shutdown_function_entry); - zval_ptr_dtor(&function_name); #else zval *function_name; #if PHP_VERSION_ID >= 80000