[php-src] master: Also destroy classes in reverse order with ZTS
| From: | Nikita Popov | Date: | Fri, 30 Apr 2021 07:59:34 +0000 |
| Subject: | [php-src] master: Also destroy classes in reverse order with ZTS | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-115973@lists.php.net to get a copy of this message | ||
Author: Nikita Popov (nikic)
Date: 2021-04-30T09:58:29+02:00
Commit: https://github.com/php/php-src/commit/feab479884352c3c215677ab1cee3dbace6e2a4e
Raw diff: https://github.com/php/php-src/commit/feab479884352c3c215677ab1cee3dbace6e2a4e.diff
Also destroy classes in reverse order with ZTS
Changed paths:
M Zend/zend.c
Diff:
diff --git a/Zend/zend.c b/Zend/zend.c
index a98a7a8486a9..e0ec9673ad05 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -730,7 +730,8 @@ static void compiler_globals_dtor(zend_compiler_globals *compiler_globals) /* {{
free(compiler_globals->function_table);
}
if (compiler_globals->class_table != GLOBAL_CLASS_TABLE) {
- zend_hash_destroy(compiler_globals->class_table);
+ /* Child classes may reuse structures from parent classes, so destroy in reverse order. */
+ zend_hash_graceful_reverse_destroy(compiler_globals->class_table);
free(compiler_globals->class_table);
}
if (compiler_globals->auto_globals != GLOBAL_AUTO_GLOBALS_TABLE) {